2011-10-20 23:36:47 +00:00
|
|
|
|
$(document).ready(function () {
|
2011-10-24 07:00:25 +00:00
|
|
|
|
$(".sliderButton").live('click', function () {
|
|
|
|
|
sliderToggle(this);
|
2011-10-20 23:36:47 +00:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2011-10-24 07:00:25 +00:00
|
|
|
|
function sliderToggle(sliderButton) {
|
|
|
|
|
//Get sliderContent
|
|
|
|
|
var sliderContent = $(sliderButton).siblings('.sliderContent');
|
|
|
|
|
|
|
|
|
|
//Open the slider
|
|
|
|
|
sliderContent.slideToggle('slow');
|
|
|
|
|
|
|
|
|
|
//Change the slider Image
|
2011-10-25 07:03:52 +00:00
|
|
|
|
$(sliderButton).children('.sliderImage').toggleClass('sliderOpened sliderClosed');
|
2011-10-20 23:36:47 +00:00
|
|
|
|
|
2011-11-12 07:56:49 +00:00
|
|
|
|
//Clear the search box
|
|
|
|
|
$(sliderContent).children('.localSeriesLookup').val('');
|
|
|
|
|
|
2011-10-24 07:00:25 +00:00
|
|
|
|
//Focus in the search box
|
|
|
|
|
$(sliderContent).children('.localSeriesLookup').focus();
|
|
|
|
|
|
|
|
|
|
//Hide the sliders
|
|
|
|
|
hideSliders(sliderContent);
|
|
|
|
|
|
2011-10-20 23:36:47 +00:00
|
|
|
|
//Prevent the Address Bar from changing
|
|
|
|
|
return false;
|
2011-10-24 07:00:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function hideSliders(newlyOpenedSlider) {
|
|
|
|
|
$('.sliderContent').each(function (index, value) {
|
|
|
|
|
var newlyOpenedSliderId = $(newlyOpenedSlider).parent('.top-slider').attr('id');
|
|
|
|
|
var id = $(this).parent('.top-slider').attr('id');
|
|
|
|
|
|
|
|
|
|
//If the ID's of the top-sliders don't match then hide it
|
|
|
|
|
if (id != newlyOpenedSliderId)
|
|
|
|
|
$(this).slideUp();
|
|
|
|
|
});
|
2011-11-12 07:56:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Hide slider when text box loses focus
|
|
|
|
|
$('.localSeriesLookup').live('blur', function () {
|
|
|
|
|
$('.sliderContent').each(function (index, value) {
|
|
|
|
|
$(this).slideUp();
|
|
|
|
|
});
|
|
|
|
|
});
|