1$( document ).ready(function() { 2 3 // Define Variables 4 // ##################################################################### 5 var starting_value = 10; 6 var last_scrollTop = $(document).scrollTop() + starting_value; 7 var current_top; 8 var direction; 9 var windowHeight = $(window).height(); 10 var background_status = "start"; 11 var startImg = new Image(); 12 var scrollImg = new Image(); 13 var ajaxURL = "http://www.rogertaylorofficial.com/wp-admin/admin-ajax.php"; 14 //var ajaxURL = "http://rogertaylor.modern-english.co.uk/wp-admin/admin-ajax.php"; 15 var image_loaded_1 = false; 16 var image_loaded_2 = false; 17 18 19 $('.rt-icon a[href^="#"], #nav a[href^="#"]').click(function(e){ 20 e.preventDefault(); 21 var target = this.hash; 22 $target = $(target); 23 $('html, body').scrollTop( $target.offset().top ); 24 }); 25 26 $("#mybook").booklet({ 27 width: '840px', 28 height: '600px', 29 closed: true, 30 autoCenter: true, 31 covers: true, 32 pagePadding: 0, 33 pageNumbers: false, 34 arrows: true, 35 startingPage: 1 36 37 }); 38 39 // Load the home page images 40 $.post( 41 ajaxURL, 42 { 43 'action': 'background_callback', 44 'data': 'home', 45 }, 46 function(response){ 47 response = response.replace("local","www"); 48 startImg.src = response; 49 } 50 ); 51 52 $.post( 53 ajaxURL, 54 { 55 'action': 'background_callback', 56 'data': 'change', 57 }, 58 function(response){ 59 response = response.replace("local","www"); 60 scrollImg.src = response; 61 } 62 ); 63 64 65 // If cookie is set, scroll to the position saved in the cookie. 66 if ( $.cookie("scroll") !== null ) { 67 $(document).scrollTop( $.cookie("scroll") ); 68 } 69 70 // Hide all album details 71 setTimeout(function(){ 72 $('.album-detail').hide(); 73 },350); 74 75 var scrollElement = $('.columns'); 76 scrollElement.hover( 77 function(){ 78 $('html,body').bind("mousewheel", function(event) { 79 event.preventDefault(); 80 }); 81 }, 82 function(){ 83 $('html,body').unbind(); 84 } 85 ); 86 87 // Add inview to the page slide 88 $('.pageSlide').bind('inview', function (event, visible) { 89 if (visible === true) { 90 $(this).addClass("inview"); 91 } else { 92 $(this).removeClass("inview"); 93 } 94 }); 95 96 // Ajax Functions 97 // ##################################################################### 98 var ajaxFn = { 99 100 checkBackground: function() { 101 102 var scrollTop = $(document).scrollTop(); 103 var pageHeight = windowHeight; 104 105 scrollImg.onload = function(){ 106 image_loaded_2 = true; 107 ajaxFn.checkBackground(); 108 } 109 110 startImg.onload = function(){ 111 image_loaded_1 = true; 112 ajaxFn.checkBackground(); 113 } 114 115 if( scrollTop > (pageHeight*2.125) && image_loaded_1 === true && image_loaded_2 === true){ 116 //$('#home #bg img').attr('src',scrollImg.src); 117 $('#home #bg').css('background-image','url("'+scrollImg.src+'")'); 118 } 119 120 if( $('#home').hasClass('inview') && image_loaded_1 === true){ 121 //$('#home #bg img').attr('src',startImg.src); 122 $('#home #bg').css('background-image','url("'+startImg.src+'")'); 123 } 124 125 } 126 127 } 128 129 // Init Functions 130 // ##################################################################### 131 var init = { 132 133 // setup variables 134 albums: $('#albums'), 135 background: $('#background'), 136 albumDetail: $('.album-detail'), 137 albumDetail_container: $('.album-detail .container_12'), 138 pageSlide: $('.pageSlide'),
139 albumBackground: $('.album-background'), 140 tabContainer: $( ".tab-container" ), 141 pageSlideHome: $('.pageSlide#home'), 142 pageSlideContent: $('.columns'), 143 pageFlooring: $('.flooring'), 144 pageGallery: $('#gallery'), 145 146 // functions 147 pageSlideHeight: function(skrollRefresh){ 148 this.background.height(window.innerHeight); 149 this.pageSlide.height(window.innerHeight); 150 this.albumBackground.height(window.innerHeight); 151 this.pageSlideHome.height(window.innerHeight * 2); 152 this.pageFlooring.height(window.innerHeight); 153 this.pageSlideContent.height(window.innerHeight - 250); 154 $('.css-columns').height(window.innerHeight - 220); 155 this.albumDetail.height(this.pageSlide.height); 156 this.tabContainer.tabs(); 157 158 this.albumDetail_container.height(this.pageSlide.height); 159 this.albums.height(window.innerHeight); 160 161 //$('.album-background').css("background-size","cover"); 162 163 setTimeout(function(){ 164 165 $('.columns').jScrollPane({ 166 mouseWheelSpeed: 250 167 }); 168 169 $('.album-description').jScrollPane({ 170 mouseWheelSpeed: 250 171 }); 172 173 $('.news-posts').jScrollPane({ 174 mouseWheelSpeed: 250 175 }); 176 177 },200); 178 179 }, 180 181 readmore: function(){ 182 $('.readmore A').click(function(ev){ 183 ev.preventDefault(); 184 var $target_base = $(this).parent().parent().parent().parent().parent().parent().parent(); 185 var $target_1 = $target_base.find('.album-detail'); 186 var $target_2 = $target_base.find('.black-box'); 187 $target_1.show(); 188 $target_2.hide(); 189 190 setTimeout(function(){ 191 192 $('.columns').jScrollPane({ 193 mouseWheelSpeed: 250 194 }); 195 196 },250); 197 198 var $target = $(this).parent().parent().parent().prev(); 199 200 $('html, body').stop().animate({ 201 'scrollTop': $target_base.offset().top 202 }, 600, 'easeInOutQuad', function () { 203 //window.location.hash = target; 204 }); 205 206 }); 207 $('.tab-container LI A').click(function(){ 208 setTimeout(function(){ 209 210 $('.columns').jScrollPane({ 211 mouseWheelSpeed: 250 212 }); 213 214 $(".fancybox-thumb").fancybox({ 215 openEffect : 'none', 216 closeEffect : 'none', 217 helpers : { 218 title : { 219 type: 'outside' 220 }, 221 thumbs : { 222 width : 50, 223 height : 50 224 } 225 } 226 }); 227 228 },200); 229 }); 230 }, 231 232 closeReadmore: function(){ 233 $('.close').click(function(ev){ 234 ev.preventDefault(); 235 var $target_base = $(this).parent().parent().parent(); 236 var $target_1 = $target_base.find('.album-detail'); 237 var $target_2 = $target_base.find('.black-box'); 238 $target_1.hide(); 239 $target_2.show(); 240 241 var $target = $(this).parent().parent().parent().prev(); 242 243 $('html, body').stop().animate({ 244 'scrollTop': $target_base.offset().top 245 }, 600, 'easeInOutQuad', function () { 246 //window.location.hash = target; 247 }); 248 249 }); 250 }, 251 252 loadNavScroll: function(){ 253 254 // init the menu 255 $('.menu-link A').click(function(ev){ 256 ev.preventDefault(); 257 $('#nav A').each(function(){ 258 $(this).removeClass('selected'); 259 }); 260 $(this).addClass('selected'); 261 }); 262 263 } 264 265 }; 266 267 // Scroll Functions 268 // ##################################################################### 269 if (last_scrollTop > starting_value-1){ 270 271 $(window).scroll(function(){ 272
273 ajaxFn.checkBackground(); 274 275 var current_top = $(document).scrollTop(); 276 277 if(current_top > last_scrollTop){ 278 direction = "down"; 279 } else { 280 direction = "up"; 281 } 282 283 $.cookie("scroll", $(document).scrollTop() ); 284 285 if( $('.inview .album-detail').is(':visible') ){ 286 287 } else { 288 289 $('.black-box').show(); 290 $('.album-detail').hide(); 291 292 } 293 294 }); 295 296 } 297 298 // Resize Function 299 // ##################################################################### 300 $(window).resize(function(){ 301 302 $('.columns').jScrollPane({ 303 mouseWheelSpeed: 250 304 }); 305 306 $('.album-description').jScrollPane({ 307 mouseWheelSpeed: 250 308 }); 309 310 $('.news-posts').jScrollPane({ 311 mouseWheelSpeed: 250 312 }); 313 314 315 $(".album-detail").show(); 316 setTimeout(function(){ 317 $(".album-detail").hide(); 318 },200); 319 320 init.pageSlideHeight(true); 321 ajaxFn.checkBackground(); 322 323 }); 324 325 init.pageSlideHeight(); 326 init.readmore(); 327 init.closeReadmore(); 328 ajaxFn.checkBackground(); 329 330 // Tooltips 331 // ##################################################################### 332 $( "ul#menu-side-navigation li a" ).hover( 333 function() { 334 //console.log($(this)); 335 $(this).closest("li").children(".tooltip").fadeIn('fast'); 336 }, function() { 337 //console.log('out'); 338 $(this).closest("li").children(".tooltip").fadeOut('fast'); 339 } 340 ); 341 342});
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.