");
elt.parent().css({ position: "relative", "height": height }).jScrollPane({ paneHeight: height, autoReinitialise: true });
try { console.log("jspScrollable applied to " + jsp.length) } catch (e) { }
}
}, 400);
});
This is the copyright info
1 of X
Photo Title
Photo caption
').appendTo('#mainbody');
$('#lightbox').appendTo($('#backdrop').css({ 'height': $(document).height() + 'px' }));
});
var lightbox = {
galleries: [],
allowInput: true,
impressionCount: 0,
viewCount: 0,
interstitialCount: 0,
interstitialInterval: 1,
advertisementCount: 0,
advertisementInterval: 1,
currentGallery: 0,
currentPhoto: 0,
currentPage: 0,
currentData: null,
modalVisible: false,
slideshowTimer: null,
slideshowInterval: 6000,
pageSize: 18,
dartMovieName: null,
dartCelebrityName: null,
init: function () {
document.domain = 'hollywood.com';
$('.next, .media').live('click', function (ev) { lightbox.stop(); lightbox.next(); });
$('#lightbox .prev').live('click', function () { lightbox.prev(); lightbox.stop(); lightbox.hideShare(); });
$('#lightbox .play').live('click', function () { lightbox.next(); lightbox.play(); lightbox.hideShare(); });
$('#lightbox .stop').live('click', function () { lightbox.stop(); lightbox.hideShare(); });
//$('#lightbox .close').live('click', function () { lightbox.stop(); lightbox.hide(); lightbox.hideShare(); });
$('#lightbox .thumbs').live('click', function () { lightbox.stop(); lightbox.toggleThumbs(); lightbox.hideShare(); lightbox.hideEmail(); });
$('#lightbox .share').live('click', function () { lightbox.stop(); lightbox.toggleShare(); });
$('#lightbox .slider li').live('click', function () { lightbox.stop(); lightbox.hideShare(); });
$('#facebook-button').live('click', function () { window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(document.location) + '&src=sp', '_blank'); });
$('#twitter-button').live('click', function () { window.open('http://twitter.com/home?status=RT%20@hollywood_com%20' + encodeURIComponent($('#lightbox .photo-title').text()) + '%20' + encodeURIComponent(document.location), '_blank'); });
$('#reddit-button').live('click', function () { window.open('http://www.reddit.com/r/pics/submit?url=' + encodeURIComponent(window.location), '_blank'); });
$('#tumblr-button').live('click', function () { window.open('http://www.tumblr.com/share?v=3&u=' + encodeURIComponent($('#lightbox .media').attr('src')) + '&t=' + $('#lightbox .photo-title').text() + '&s=', '_blank'); });
$('#lightbox #email-button').live('click', function () { lightbox.stop(); lightbox.toggleEmail(); });
$('#lightbox .email .button').live('click', function () { lightbox.sendEmail(); });
$('#lightbox .email-close').live('click', function () { lightbox.hideEmail(); lightbox.hideShare(); });
$('#lightbox #to-address, #lightbox #from-address').focus(function () {
if ($(this).attr('value') == 'email address') {
$(this).attr('value', '').css('color', '#000');
}
});
$('#lightbox .slider').mouseenter(function () {
if (lightbox.currentPhoto == 0) {
$('#lightbox .slider .next').fadeIn();
} else if ((lightbox.currentPhoto + 1) == lightbox.currentData.slides.length) {
$('#lightbox .slider .prev').fadeIn();
} else {
$('#lightbox .slider .next, #lightbox .slider .prev').fadeIn();
}
});
$('#lightbox .slider').mouseleave(function () {
$('#lightbox .slider .next, #lightbox .slider .prev').fadeOut();
});
// WIRE UP KEY PRESS EVENTS FOR THIS LIGHTBOX
$(window).keyup(function (e) {
lightbox.hideShare();
if (e.keyCode) {
switch (e.keyCode) {
case 27: lightbox.hide(); break; // Escape
case 37: lightbox.prev(); break; // Left Arrow
case 39: lightbox.next(); break; // Right Arrow
}
}
});
// HIDE AND SHOW NEXT AND PREV ON ROLL OVER
$('#lightbox .main').mouseenter(function () { $('#lightbox .main .prev, #lightbox .main .next').fadeIn(); });
$('#lightbox .main').mouseleave(function () { $('#lightbox .main .prev, #lightbox .main .next').fadeOut(); });
},
show: function (galleryId) {
if (this.currentGallery != galleryId) {
this.currentPhoto = 0;
this.currentGallery = galleryId;
// CHECK IF DATA REQUESTED IS ALREADY DOWNLOADED
var exists = false;
for (i = 0; i ';
for (i = 0; i
'; //t += '
'; } t += ''; $(t).appendTo($('#lightbox .slider').empty()); $('').appendTo($('#lightbox .advert').empty()); } // SHOW THE LIGHTBOX if (!$('#lightbox').is(':visible')) { $('#backdrop').fadeIn(function () { $('#lightbox').fadeIn(function () { this.modalVisible = true; window.scrollTo(0, 0); }); }); } }, hide: function () { if ($('#lightbox').is(':visible')) { $('#backdrop').hide(); this.modalVisible = false; } }, next: function () { if ((this.currentPhoto + 1) -1) { var hash = this.currentPhoto - 1; document.location = '#p' + hash + ',g' + this.currentGallery; } }, changePage: function (pageIndex) { var t = ''; $(t).appendTo($('#lightbox .inner-list').empty()); $('#lightbox .inner-list img').load(function () { $(this).fadeIn(); }); pageCount = Math.ceil(this.currentData.slides.length / this.pageSize); if (pageCount '; // PREV BUTTON if (pageIndex == 0) { pager += '
?'; } else { pager += '
?'; } // PAGE BUTTONS var offset = pageIndex - 5; if ((pageCount - offset) = 10) ? 10 : pageCount; if (offset ' + pageNumber + ''; } else { pager += '
' + pageNumber + ''; } } // NEXT BUTTON if ((pageIndex + 1) == pageCount) { pager += '
?'; } else { pager += '
?'; } pager += ''; $(pager).appendTo($('#lightbox .inner-list')); }, changeMedia: function (index) { this.hideShare(); this.hideEmail(); this.hideThumbs(); this.reportPageView(); this.allowInput = false; setTimeout(function () { allowInput = true; }, 500); if (this.interstitialCount >= this.interstitialInterval) { this.showInterstitial(); this.interstitialCount = 0; } if (this.advertisementCount >= this.advertisementInterval) { this.refreshAdvertisements(); this.advertisementCount = 0; } var thumbSize = 83; if (index > this.currentPhoto) { // MOVE FORWARD var diff = index - this.currentPhoto; var move = (diff * thumbSize); var dir = '-='; } else { // MOVE BACKWARD var diff = this.currentPhoto - index; var move = (diff * thumbSize); var dir = '+='; } function setCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; } function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i 0) { dartMetaProps += "celeb=" + dartCelebrityName; } if (dartMovieName.length > 0) { if (dartMetaProps.length > 0) { dartMetaProps += ";movie=" + dartMovieName; } else { dartMetaProps += "movie=" + dartMovieName; } } if ((viewAdCounter % 5) == 0) { viewAdCounter = 0; $('#lightbox .media').wrap(''); $('#lightbox .media').hide(); $('#lightbox .take-over').css("marginTop", "135px"); $('').appendTo('#lightbox .take-over'); $('#lightbox .gallery-type').text(''); } else { $('#lightbox .lightbox-advert').unwrap(); $('#lightbox .media').show(); $('#lightbox .lightbox-advert').remove(); } setCookie('viewAdCounter', viewAdCounter, 1); } else { setCookie('viewAdCounter', '1', 1); } this.currentPhoto = index; this.advertisementCount++; this.interstitialCount++; $('#lightbox .copyright').fadeOut(); $('#lightbox .slider ul').animate({ 'left': dir + move + 'px' }, 300, 'swing', function () { $('#lightbox .media').fadeOut(function () { $('#lightbox .media').attr('src', lightbox.currentData.slides[index].source); $('#lightbox .photo-title').html('
' + lightbox.currentData.slides[index].title + ''); $('#lightbox .photo-caption').html('
' + lightbox.currentData.slides[index].caption + ''); $('#lightbox .copyright').html('
' + lightbox.currentData.slides[index].copyright + '');
var currentPhotoNumber = parseInt(index) + 1;
$('#lightbox .count').text(currentPhotoNumber + ' of ' + lightbox.currentData.slides.length);
$('#lightbox .media').load(function () {
$(this).fadeIn(function () {
allowInput = true;
$('#lightbox .copyright').fadeIn();
});
var w = $(this).width();
var h = $(this).height();
if (w > h) { $(this).css({ 'width': '580px', 'height': 'auto' }); }
else { $(this).css({ 'width': 'auto', 'height': '480px' }); }
});
});
});
},
play: function () {
$('#lightbox .play').addClass('stop').removeClass('play');
this.slideshowTimer = setInterval(function () { lightbox.next(); }, this.slideshowInterval);
},
stop: function () {
$('#lightbox .stop').addClass('play').removeClass('stop');
clearInterval(this.slideshowTimer);
},
hideShare: function () { if ($('#lightbox .share-icons').css('top') == '552px') { $('#lightbox .share-icons').animate({ 'top': '595px', 'height': '0px' }, 800, 'swing'); } },
showShare: function () { if ($('#lightbox .share-icons').css('top') == '595px') { $('#lightbox .share-icons').animate({ 'top': '552px', 'height': '43px' }, 800, 'swing'); } },
toggleShare: function () { this.hideEmail(); if ($('#lightbox .share-icons').css('top') == '552px') { this.hideShare(); } else { this.showShare(); } },
showEmail: function () { if ($('#lightbox .email').css('top') == '595px') { $('#lightbox .email').animate({ 'top': '490px', 'height': '105px' }, 800, 'swing'); } },
hideEmail: function () { if ($('#lightbox .email').css('top') == '490px' || $('#lightbox .email').css('top') == '470px') { $('#lightbox .email').animate({ 'top': '595px', 'height': '0px' }, 800, 'swing'); } },
toggleEmail: function () { if ($('#lightbox .email').css('top') == '490px' || $('#lightbox .email').css('top') == '470px') { this.hideEmail(); } else { this.showEmail(); } },
sendEmail: function () {
// VALIDATE DATA
var isValid = true;
if (!this.validateEmail(document.getElementById('to-address').value)) { $('#to-address').addClass('error'); isValid = false; } else { $('#to-address').removeClass('error'); }
if (!this.validateEmail(document.getElementById('from-address').value)) { $('#from-address').addClass('error'); isValid = false; } else { $('#from-address').removeClass('error'); }
if (!isValid) { this.showEmailError('Invalid email address. Please try again.'); return; }
this.hideEmail();
// POST DATA TO EMAIL SERVICE
var data = {
to: document.getElementById('to-address').value,
from: document.getElementById('from-address').value,
body: document.getElementById('email-body').value,
link: document.location.toString(),
subject: $('#lightbox .gallery-title').text()
};
$.post("/Services/ShareEmail.ashx", data, function (result) {
if (result.status && result.status == 'success') {
}
}, 'json');
},
showEmailError: function (text) {
if ($('#lightbox .email').css('top') == '490px') {
$('#lightbox .email').animate({ 'top': '470px', 'height': '125px' }, 800, 'swing');
$('#lightbox .email .error-message').text(text);
}
},
validateEmail: function (elementValue) {
var emailPattern = /^(([^()[\]\\.,;:\s@\"]+(\.[^()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return emailPattern.test(elementValue);
},
showThumbs: function () {
this.changePage(0);
if ($('#lightbox .inner-list').css('top') == '595px') {
$('#lightbox .inner-list').animate({ 'top': '73px', 'height': '521px' }, 800, 'swing');
}
},
hideThumbs: function () {
if ($('#lightbox .inner-list').css('top') == '73px') {
$('#lightbox .inner-list').animate({ 'top': '595px', 'height': '0px' }, 800, 'swing');
}
},
toggleThumbs: function () {
if ($('#lightbox .inner-list').css('top') == '73px') {
this.hideThumbs();
} else {
this.showThumbs();
}
},
hideInterstitial: function () { },
showInterstitial: function () { },
reportPageView: function () { },
refreshAdvertisements: function () {
var ifrm = document.getElementById('lightbox-advert');
var base = " www.hollywood.com/tv/photos/id=";
switch (this.currentData.content_type) {
case "Event Gallery":
case "Feature Gallery":
case "Flip Book":
base = "www.hollywood.com/celebrities/photos/id=";
break;
case "Movie Stills":
case "Premiere Gallery":
base = "www.hollywood.com/movies/photos/id=";
break;
case "TV Event Gallery":
case "TV Premiere Gallery":
case "TV Premieres":
case "TV Event Gallery":
case "TV Stills":
base = "www.hollywood.com/tv/photos/id=";
break;
}
var dartMetaProps = "";
if (dartCelebrityName.length > 0) {
dartMetaProps += "celeb=" + dartCelebrityName;
}
if (dartMovieName.length > 0) {
if (dartMetaProps.length > 0) {
dartMetaProps += ";movie=" + dartMovieName;
}
else {
dartMetaProps += "movie=" + dartMovieName;
}
}
$('').appendTo($('#lightbox .advert').empty()); } } lightbox.init(); var storedHash = ''; function getHash() { var hash = { page: -1, photo: -1, gallery: -1 }; var parts = storedHash.substr(1).split(','); if (parts.length > 1) { for (i = 0; i
john wooden tanuki mirror mirror trailer bob knight bob knight lavar arrington hope solo dancing with the stars
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.