Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var $previous_hover, $previous_scheme = null;
- $('input:checkbox').change(function(){
- var $this = $(this);
- var $album = $('.album');
- var $caption = $('.thumb-caption');
- var $currentHov = $this.data('hover');
- var $currentSch = $this.data('scheme');
- // Only remove the class in the specific `box` that contains the radio
- $this.closest('.selection').find('li.active').removeClass('active');
- // $this.prop('checked', false);
- $this.closest('.option').addClass('active');
- if ($this.closest('.selection input:checkbox').is(':checked')) {
- $album.addClass($currentHov);
- } else if ($this.closest('#hover-nav.selection').not(':checked')){
- $album.removeClass($previous_hover);
- }
- if ($this.closest('.selection input:checkbox').is(':checked')){
- $caption.addClass($currentSch);
- } else if ($this.closest('.selection input:checkbox').not(':checked')){
- $caption.removeClass($previous_scheme);
- }
- $previous_hover = $currentHov;
- $previous_scheme = $currentSch;
- if ($album.hasClass('hover05')) {
- $caption.children().hide();
- $caption.append('<span class="magnify"></span>');
- } else {
- $('.magnify').remove();
- $caption.children().show();
- }
- });
- <div id="settings-panel">
- <form id="settings-inner" name="settingsform">
- <span id="settings-icon"></span>
- <ul id="color-picker" class="selection">
- <li id="scheme01" class="option active">
- <label>
- <div class="color1">
- <input class="hide" type="checkbox" name="scheme" value="scheme01" data-scheme="default" />
- </div>
- <span>Scheme 1</span>
- </label>
- </li>
- <li id="scheme02" class="option">
- <label>
- <div class="color2">
- <input class="hide" type="checkbox" name="scheme" value="scheme02" data-scheme="scheme02" />
- </div>
- <span>Scheme 2</span>
- </label>
- </li>
- <!-- <li id="scheme03"><span class="color3"></span><span>scheme 3</span></li>
- <li id="scheme04"><span class="color4"></span><span>scheme 4</span></li>
- <li id="scheme05"><span class="color5"></span><span>scheme 5</span></li>
- <li id="scheme06"><span class="color6"></span><span>scheme 6</span></li> -->
- </ul>
- <ul id="hover-nav" class="selection cf">
- <li class="option active">
- <label>
- <input class="hide" type="checkbox" name="hover" value="nohover" data-hover="nohover" />
- No Hover
- </label>
- </li>
- <li class="option">
- <label>
- <input class="hide" type="checkbox" name="hover" value="hover01" data-hover="hover01" />
- Hover Style 01
- </label>
- </li>
- <li class="option">
- <label>
- <input class="hide" type="checkbox" name="hover" value="hover02" data-hover="hover02" />
- Hover Style 02
- </label>
- </li>
- <li class="option">
- <label>
- <input class="hide" type="checkbox" name="hover" value="hover03" data-hover="hover03" />
- Hover Style 03
- </label>
- </li>
- <li class="option">
- <label>
- <input class="hide" type="checkbox" name="hover" value="hover04" data-hover="hover04" />
- Hover Style 04
- </label>
- </li>
- <li class="option">
- <label>
- <input class="hide" type="checkbox" name="hover" value="hover055" data-hover="hover05" />
- Hover Style 05
- </label>
- </li>
- </ul>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement