1var slide_effect = 'fade'; 2var slide_direction = 'N'; 3var slide_mode = 'normal'; 4 5$(document).ready(function(){ 6 7 bindEvents(); 8 9}); 10 11function bindEvents(){ 12 13 // set options 14 if (slide_effect == 'fade' || slide_effect == 'none') { 15 hideObject($('.slide-directions'), 'slide') 16 } else { 17 if (slide_effect == 'simpleSlide') { 18 hideObject($('.mode-randome'), 'none'); 19 if (slide_mode == 'random') slide_mode = 'normal'; 20 if ($('INPUT.direction').index($("INPUT#dir-"+slide_direction.toLowerCase()+"")) > 3) { 21 slide_direction = 'N'; 22 } 23 24 } else showObject($('.mode-randome'), 'none'); 25 26 showObject($('.slide-directions'), 'slide'); 27 28 if (slide_effect == 'superSlide') showObject($('.super-directions'), 'none'); 29 else hideObject($('.super-directions'), 'none'); 30 } 31 32 if (slide_mode == 'random') { 33 $('#nav').html(''); 34 hideObject($('.nav-buttons'), 'fade'); 35 } else showObject($('.nav-buttons'), 'fade'); 36 37 $('#toggleAnimation').html("Pause Animation"); 38 39 $("select#effect option[value='"+slide_effect+"']").attr("selected", true); 40 $("INPUT#dir-"+slide_direction.toLowerCase()+"").attr('checked', 'checked'); 41 $("INPUT#"+slide_mode+"").attr('checked', 'checked'); 42 43 // Play / pause button 44 $('#toggleAnimation').unbind('click'); 45 $('#toggleAnimation').click(function(){ 46 if ($(this).html() == "Pause Animation"){ 47 $(this).html("Resume Animation"); 48 $('BODY').bgStretcher.pause(); 49 } else { 50 $(this).html("Pause Animation"); 51 $('BODY').bgStretcher.play(); 52 } 53 }); 54 55 // Change Effect 56 $('SELECT#effect').unbind('change'); 57 $('SELECT#effect').change(function(){ 58 if ($(this).val() == slide_effect) return true; 59 slide_effect = $(this).val(); 60 $('BODY').bgStretcher.sliderDestroy(); 61 initBgStretcher(); 62 bindEvents(); 63 return true; 64 }); 65 66 // Change Direction 67 $('INPUT.direction').unbind('change'); 68 $('INPUT.direction').change(function(){ 69 var new_slide_deriction = $('INPUT.direction:checked').attr('id').split('dir-'); 70 new_slide_deriction = new_slide_deriction[1].toUpperCase(); 71 72 if (new_slide_deriction == slide_direction) return true; 73 slide_direction = new_slide_deriction; 74 75 $('BODY').bgStretcher.sliderDestroy(); 76 initBgStretcher(); 77 bindEvents(); 78 return true; 79 }); 80 81 // Change Mode 82 $('INPUT.mode').unbind('change'); 83 $('INPUT.mode').change(function(){ 84 if ($(this).attr('id') == slide_mode) return true; 85 slide_mode = $(this).attr('id'); 86 87 $('BODY').bgStretcher.sliderDestroy(); 88 initBgStretcher(); 89 bindEvents(); 90 return true; 91 }); 92 93 return true; 94} 95 96function initBgStretcher(){ 97 98 $('BODY').bgStretcher({ 99 images: ['images/sample-1.jpg', 'images/sample-2.jpg', 'images/sample-3.jpg', 'images/sample-4.jpg', 'images/sample-5.jpg', 'images/sample-6.jpg'], 100 imageWidth: 1024, 101 imageHeight: 768, 102 slideDirection: slide_direction, 103 slideShowSpeed: 1000, 104 transitionEffect: slide_effect, 105 sequenceMode: slide_mode, 106 buttonPrev: '#prev', 107 buttonNext: '#next', 108 pagination: '#nav', 109 anchoring: 'left center', 110 anchoringImg: 'left center' 111 }); 112} 113 114 115function hideObject(obj, hide_effect) { 116 if (($.browser.msie) && (parseInt(jQuery.browser.version) == 6)) { 117 obj.css({position: 'absolute', left: '-100000px'}); 118 } else { 119 if (hide_effect == 'slider') obj.slideUp(); 120 else if (hide_effect == 'fade') obj.fadeOut(); 121 else obj.hide(); 122 } 123 return true; 124} 125function showObject(obj, hide_effect) { 126 if (($.browser.msie) && (parseInt(jQuery.browser.version) == 6)) { 127 obj.css({position: 'static', left: '0px'}); 128 } else { 129 if (hide_effect == 'slider') obj.slideDown(); 130 else if (hide_effect == 'fade') obj.fadeIn(); 131 else obj.show(); 132 } 133 return true; 134}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.