-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
progressbarsk
committed
Sep 9, 2012
1 parent
ed8f612
commit ecd25a5
Showing
5 changed files
with
57 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1 @@ | ||
$(function() { | ||
if (!Modernizr.input.placeholder) { | ||
$('html').addClass('no-placeholder'); | ||
} | ||
|
||
if (typeof $.scrollTo === 'function') { | ||
$('a.scroll').bind('click', function () { | ||
var a = $(this), | ||
scroll_to = $(a.attr('href')); | ||
if (scroll_to.length > 0) { | ||
$.scrollTo(scroll_to, 1000); | ||
} | ||
|
||
return false; | ||
}); | ||
} | ||
|
||
if (typeof $.fancybox === 'function') { | ||
$('a.lightbox').fancybox({ | ||
'titlePosition': 'inside' | ||
}); | ||
} | ||
|
||
}); | ||
$('html').removeClass('no-js').addClass('js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,61 @@ | ||
$(function() { | ||
var promo = $('#promoss'); | ||
var promo = $('#promo'), | ||
promo_cnt = $('#promo-content'), | ||
promo_nav = $('#promo-nav'), | ||
promo_items = [], promo_active_item = null, promo_auto_animate = true, promo_timer = null; | ||
|
||
if (promo.length > 0) { | ||
var promo_cnt = $('#promo-content'), | ||
promo_nav = $('#promo-nav'), | ||
promo_items = promo.find('.promo-item'), | ||
promo_active_item = null, | ||
promo_auto_animate = true, | ||
promo_timer = null, | ||
loc_hash = document.location.hash; | ||
|
||
if (promo.find(loc_hash).length === 0) { | ||
function promoAnimate() { | ||
promo_items.each(function () { | ||
var elm = $(this), | ||
promo_items = promo.find('.promo-item'); | ||
|
||
promo_nav.delegate('a', 'click', function () { | ||
clearTimeout(promo_timer); | ||
promo_auto_animate = false; | ||
promo_active_item = $($(this).attr('href')).get(0); | ||
promoAnimate(); | ||
return false; | ||
}); | ||
|
||
function promoAnimate() { | ||
promo_items.each(function () { | ||
var elm = $(this), | ||
elm_anchor = promo_nav.find('a[href|="#' + this.id + '"]'); | ||
|
||
if (this.id != promo_active_item.id) { | ||
elm.removeClass('active'); | ||
elm_anchor.removeClass('active'); | ||
elm.fadeTo('normal', 0.3); | ||
} else { | ||
elm.addClass('active'); | ||
elm_anchor.addClass('active'); | ||
elm.fadeTo('normal', 1); | ||
} | ||
}); | ||
} | ||
|
||
promo_nav.delegate('a', 'mouseover', function () { | ||
clearTimeout(promo_timer); | ||
promo_auto_animate = false; | ||
promo_active_item = $($(this).attr('href')).get(0); | ||
promoAnimate(); | ||
if (this.id != promo_active_item.id) { | ||
elm.removeClass('active'); | ||
elm_anchor.removeClass('active'); | ||
elm.fadeTo('normal', 0.3); | ||
} else { | ||
elm.addClass('active'); | ||
elm_anchor.addClass('active'); | ||
elm.fadeTo('fast', 1); | ||
} | ||
}); | ||
} | ||
|
||
function promoAnimateTimer () { | ||
promo_timer = setTimeout(function () { | ||
if (promo_auto_animate && promo_active_item !== promo_items.last()) { | ||
var active_index = promo_active_item ? promo_items.index(promo_active_item) : -1; | ||
promo_active_item = promo_items.get(active_index + 1); | ||
function promoAnimateTimer () { | ||
var last_item = promo_items.last(); | ||
promo_timer = setTimeout(function () { | ||
if (promo_auto_animate && promo_active_item !== last_item) { | ||
var active_index = promo_active_item ? promo_items.index(promo_active_item) : -1; | ||
promo_active_item = promo_items.get(active_index + 1); | ||
|
||
if (promo_active_item) { | ||
promoAnimate(); | ||
promoAnimateTimer(); | ||
} else { | ||
clearTimeout(promo_timer); | ||
promo_auto_animate = false; | ||
} | ||
if (promo_active_item) { | ||
promoAnimate(); | ||
promoAnimateTimer(); | ||
} else { | ||
clearTimeout(promo_timer); | ||
promo_auto_animate = false; | ||
} | ||
}, promo_active_item ? 4000 : 10); | ||
|
||
return false; | ||
} | ||
} else { | ||
clearTimeout(promo_timer); | ||
promo_auto_animate = false; | ||
} | ||
}, promo_active_item ? 4000 : 10); | ||
|
||
// promoAnimateTimer(); | ||
return false; | ||
} | ||
|
||
promoAnimateTimer(); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters