Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ww = document.body.clientWidth;
- var wheight = screen.height;
- function scrollHead(){
- var itemOffset = $('.main_body_content').offset().top;
- var scrollTop = $(window).scrollTop() + 65;
- if(scrollTop >= itemOffset){
- $("#superheader").removeClass("large").addClass("small");
- $(".header").addClass("zindex");
- $("body").addClass("no-color");
- $('.scrollup').fadeIn();
- }else {
- $("#superheader").removeClass("small").addClass("large");
- $(".header").removeClass("zindex");
- $("body").removeClass("no-color");
- $('.scrollup').fadeOut();
- }
- }
- $(window).on("scroll resize orientationchange", function(){
- scrollHead();
- });
- $(document).ready(function() {
- $('.scrollup').click(function(){
- $("html, body").animate({ scrollTop: 0 }, 600);
- return false;
- });
- /********************************************** responsive navigation end ----------------------*/
- $('#nav-open-btn').click(function(){
- $('#nav.mobile-nav').toggleClass('navshow navhide');
- $('#inner-wrap').toggleClass('posa');
- })
- /********************************************** responsive navigation end ----------------------*/
- ///////////////////////////////////////////language selector///////////////////////////////////////////////
- $('.select_arrow').click(function(e){
- e.stopPropagation();
- $('.list_language').toggleClass('active').slideToggle('slow');
- $('#up-down').toggleClass('icon-chevron_down icon-chevron_up');
- })
- function hideAndFade(){
- setTimeout(function() {
- $('.list_language').removeClass('active').fadeOut();
- $('#up-down').removeClass('icon-chevron_up').addClass('icon-chevron_down');
- },50)
- }
- function addTextAndFlag(){
- var getc = $(this).find(".flag").attr("class");
- var gett = $(this).find(".l_text").attr("title");
- $( ".select_arrow .flag" ).removeClass().addClass(getc);
- $( ".select_arrow .l_text" ).text(gett);
- hideAndFade();
- }
- function hideshow(){
- setTimeout(function() {
- $('.list_language').removeClass('active').slideUp();
- $('#up-down').removeClass('icon-chevron_up').addClass('icon-chevron_down');
- },50)
- }
- $(document).mouseup(function (e)
- {
- var container = $(".language_selector");
- var res_menu = $('.nav');
- if (!container.is(e.target) // if the target of the click isn't the container...
- && container.has(e.target).length === 0) // ... nor a descendant of the container
- {
- hideshow();
- }
- });
- $('#list_lang li').click(addTextAndFlag);
- ///////////////////////////////////////////language selector end ///////////////////////////////////////////////
- ///////////responsive menu
- $(".nav li a").each(function() {
- if ($(this).next().length > 0) {
- $(this).addClass("parent");
- };
- })
- $(".toggleMenu").on('click', function(e) {
- e.preventDefault();
- $(this).toggleClass("active");
- if($('#nav-open-btn').hasClass('active')){
- $(".nav").height(wheight);
- $(".main_body_content, .banner_wrap").css({
- 'margin-left': '75%'
- });
- } else {
- $(".main_body_content, .banner_wrap").css({
- 'margin-left': '0'
- });
- }
- //$(".nav").toggle();
- });
- $('.banner_wrap, .main_body_content').click(function(){
- if($('#nav-open-btn').hasClass('active')){
- $('#nav-open-btn').removeClass('active');
- $(".main_body_content, .banner_wrap").css({
- 'margin-left': '0'
- });
- }
- })
- adjustMenu();
- //responsive menu end
- // //IE fallback for Placeholder in input feild start
- })
- //document ready end
- function ifClickOutOfBox(){
- $(document).mouseup(function (e)
- {
- var container = $(".nav li");
- if (!container.is(e.target) // if the target of the click isn't the container...
- && container.has(e.target).length === 0) // ... nor a descendant of the container
- {
- container.removeClass('hover');
- }
- });
- }
- $(window).bind('resize orientationchange', function() {
- ww = document.body.clientWidth;
- adjustMenu();
- if(ww>700){
- $('.nav li').off('click');
- }
- });
- var adjustMenu = function() {
- if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/Android/i)) || ww<700) {
- $(".nav li").unbind('mouseenter mouseleave');
- $(".nav li a.parent").unbind('click').bind('click', function(e) {
- e.preventDefault();
- $(this).parent("li").toggleClass("hover");
- });
- if(ww < 1030 ){
- $('.nav li').click(function(){
- $(this).siblings('li').removeClass('hover');
- })
- }
- ifClickOutOfBox();
- } else {
- ifClickOutOfBox();
- $(".nav li").unbind('mouseenter mouseleave').bind('mouseenter mouseleave', function() {
- // must be attached to li so that mouseleave is not triggered when hover over submenu
- $(this).toggleClass('hover');
- });
- $(".nav li").mouseover(function(){
- $(this).siblings('li').removeClass('hover');
- })
- $(".nav li").unbind('click');
- }
- }
- $(document).ready(function(){
- $('.nav').mouseleave(function() {
- $('.nav li').removeClass('hover');
- });
- if(!Modernizr.input.placeholder){
- $('[placeholder]').focus(function() {
- var input = $(this);
- if (input.val() == input.attr('placeholder')) {
- input.val('');
- input.removeClass('placeholder');
- }
- }).blur(function() {
- var input = $(this);
- if (input.val() == '' || input.val() == input.attr('placeholder')) {
- input.addClass('placeholder');
- input.val(input.attr('placeholder'));
- }
- }).blur();
- $('[placeholder]').parents('form').submit(function() {
- $(this).find('[placeholder]').each(function() {
- var input = $(this);
- if (input.val() == input.attr('placeholder')) {
- input.val('');
- }
- })
- });
- }
- //IE fallback for Placeholder in input feild end
- $(".breadcrumbs a").each(function(n) {
- $(this).attr("class", "bread" + n);
- });
- $(".accodion_body").each(function(n) {
- $(this).addClass("acc" + n);
- })
- $(".title_acc").click(function(){
- $(".horizontal_accordion .accodion_body, .title_acc").removeClass('active');
- $(this).addClass("active");
- $(this).next().addClass('active');
- var getAccHeight = $(".accodion_body.active").outerHeight();
- $(this).parents(".horizontal_accordion").height(getAccHeight + 90);
- })
- $(".prog-bar").each(function() {
- $(this)
- .data("origWidth", $(this).width())
- .width(0)
- .animate({
- width: $(this).data("origWidth")
- }, 3000);
- });
- // open accordion with first box open
- $(".full-width #accordion-container > .accordion-header").first().removeClass("inactive-header").addClass("active-header").next().slideDown().addClass("open-content");
- var a = $(".accordion-header").width();
- $(".accordion-content").css({
- 'width': a
- });
- $(".accordion-header").click(function () {
- if ($(this).is(".inactive-header")) {
- $(".accordion-content").slideUp().removeClass("open-content");
- $(".accordion-header").removeClass("active-header").addClass("inactive-header");
- $(this).removeClass("inactive-header").addClass("active-header");
- $(this).next().slideDown().addClass("open-content")
- } else {
- $(this).removeClass("active-header").addClass("inactive-header");
- $(this).next().slideUp().removeClass("open-content")
- }
- });
- return false
- //end document ready.
- })
- // (function($){
- // })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement