Показать сообщение отдельно
  #3 (permalink)  
Старый 06.04.2014, 13:09
Аспирант
Отправить личное сообщение для Alex1233 Посмотреть профиль Найти все сообщения от Alex1233
 
Регистрация: 06.04.2014
Сообщений: 45

Продолжение:

// call Isotope as a callback
function( newElements ) {
var newElems = jQuery(newElements).css({ opacity: 0 });
newElems.imagesLoaded(function(){
$container.isotope('appended', newElems);
//projectThumbInit();
});
//After infi-fresh, need-run-js again:
//click img-in-list to prettyphtot
if(navigator.platform != "iPhone" || navigator.platform != 'iPod'){	
$("a[rel^='prettyPhoto']").prettyPhoto({
animation_speed: 'fast', /* fast/slow/normal */
slideshow: false, /* false OR interval time in ms */
autoplay_slideshow: false, /* true/false */
opacity: 0.80, /* Value between 0 and 1 */
show_title: false, /* true/false */
allow_resize: true, /* Resize the photos bigger than viewport. true/false */
default_width: 500,
default_height: 344,
counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
wmode: 'opaque', /* Set the flash wmode attribute */
autoplay: true, /* Automatically start videos: True/False */
modal: false, /* If set to true, only the close button will close the window */
overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
social_tools:false
});
}
//jQuery(window).unbind('.infscr');
//hovoer on img-in-list 



demHover();



// need-run-js over
});
//Infinits Scroll end 
});

// #################################
// Responsive Menus
// ################################
(function($){

//variable for storing the menu count when no ID is present
var menuCount = 0;

//plugin code
$.fn.mobileMenu = function(options){

//plugin's default options
var settings = {
switchWidth: 930,
topOptionText: 'Menu',
indentString: '---'
};


//function to check if selector matches a list
function isList($this){
return $this.is('ul, ol');
}


//function to decide if mobile or not
function isMobile(){
return ($(window).width() < settings.switchWidth);
}


//check if dropdown exists for the current element
function menuExists($this){

//if the list has an ID, use it to give the menu an ID
if($this.attr('id')){
return ($('#mobileMenu_'+$this.attr('id')).length > 0);
} 

//otherwise, give the list and select elements a generated ID
else {
menuCount++;
$this.attr('id', 'mm'+menuCount);
return ($('#mobileMenu_mm'+menuCount).length > 0);
}
}


//change page on mobile menu selection
function goToPage($this){
if($this.val() !== null){document.location.href = $this.val()}
}


//show the mobile menu
function showMenu($this){
$this.css('display', 'none');
$('#mobileMenu_'+$this.attr('id')).show();
}


//hide the mobile menu
function hideMenu($this){
$this.css('display', '');
$('#mobileMenu_'+$this.attr('id')).hide();
}


//create the mobile menu
function createMenu($this){
if(isList($this)){

//generate select element as a string to append via jQuery
var selectString = '<select id="mobileMenu_'+$this.attr('id')+'" class="mobileMenu">';

//create first option (no value)
selectString += '<option value="">'+settings.topOptionText+'</option>';

//loop through list items
$this.find('li').each(function(){

//when sub-item, indent
var levelStr = '';
var len = $(this).parents('ul, ol').length;
for(i=1;i<len;i++){levelStr += settings.indentString;}

//get url and text for option
var link = $(this).find('a').attr('href');
var text = levelStr + $(this).clone().find('ul, ol, span').remove().end().text();

//add option
selectString += '<option value="'+link+'">'+text+'</option>';
});

selectString += '</select>';

//append select element to ul/ol's container
$this.parent().append(selectString);

//add change event handler for mobile menu
$('#mobileMenu_'+$this.attr('id')).change(function(){
goToPage($(this));
});

//hide current menu, show mobile menu
showMenu($this);
} else {
alert('mobileMenu will only work with UL or OL elements!');
}
}


//plugin functionality
function run($this){

//menu doesn't exist
if(isMobile() && !menuExists($this)){
createMenu($this);
}

//menu already exists
else if(isMobile() && menuExists($this)){
showMenu($this);
}

//not mobile browser
else if(!isMobile() && menuExists($this)){
hideMenu($this);
}

}

//run plugin on each matched ul/ol
//maintain chainability by returning "this"
return this.each(function() {

//override the default settings if user provides some
if(options){$.extend(settings, options);}

//cache "this"
var $this = $(this);

//bind event to browser resize
$(window).resize(function(){run($this);});

//run plugin
run($this);

});

};

})(jQuery);

// #################################
// Triggle - Responsive Menus
// ################################
$('#menu-navi').mobileMenu();

// #################################
// Triggle - flexslider
// ################################
$('.flexslider').flexslider();

// #################################
// Reponsive sidebar open
// ################################
$(".clum2_sidebar_unit h3 span").click(function () {
$(this).parent().siblings('.widget_con').slideToggle(500, function() {
/**/if ($(this).is(":visible")) {
$(this).siblings('h3').children('span').removeClass('widget_open').addClass('widget_close');
}else{
$(this).siblings('h3').children('span').removeClass('widget_close').addClass('widget_open');
}
});
});

// #################################
// Client for image in list
// #################################
if(navigator.platform == "iPhone" || navigator.platform == "iPad" || navigator.platform == 'iPod') {
$('img').css('margin-bottom','-6px');
}
/*if(navigator.platform == "Linux armv71") {
$('img').css('margin-bottom','-7px');
}*/

});
Ответить с цитированием