Posts

Showing posts from June, 2015

Add Active Class With Refresh Page

 $("#Selcetor-name li").click(function () {         var id = $(this).attr("id");         $('#' + id).siblings().find(".active").removeClass("active");         //                       ^ you forgot this         $('#' + id).addClass("active");         localStorage.setItem("selectedolditem", id);     });     var selectedolditem = localStorage.getItem('selectedolditem');     if (selectedolditem != null) {         $('#' + selectedolditem).siblings().find(".active").removeClass("active");         //              ...

Accourding Menu

/************************************Jquery***********************************/ $(".Selector h1").click(function () {                if ($(this).next("table").is(":visible")) {                    $(this).next("table").slideUp("slow");                } else {                    $(".menu-items table").slideUp("slow");                    $(this).next("table").slideToggle("slow");                }            }); /************************************HTML*************...

Get Retina Display & Add Dynamic Retina CSS & Replace Images

/******************************Get DevicePixelRatio ********************************/ (function (window) { window.getDevicePixelRatio = function () { var ratio = 1; // To account for zoom, change to use deviceXDPI instead of systemXDPI if (window.screen.systemXDPI !== undefined && window.screen.logicalXDPI !== undefined && window.screen.systemXDPI > window.screen.logicalXDPI) { // Only allow for values > 1 ratio = window.screen.systemXDPI / window.screen.logicalXDPI; } else if (window.devicePixelRatio !== undefined) { ratio = window.devicePixelRatio; } return ratio; }; })(this); /*********************************Get CSS & Images ********************************/ var devicePixelRatio = window.getDevicePixelRatio();             var path = $("#device1").attr('href');             var fileExt = path.split('.').shift();      ...

Text Convert Single Letters with Class Name

/*Text Convert Letters with Class Name*/  $.fn.texter = function () {                 //debugger;                 var letters = $(this).html().split(""),                     text = "";                 for (var i in letters) {                     text += "<span class='" + letters[i] + "'>" + letters[i] + "</span>";                     //console.log(letters[i]);                 }   ...

Bootstrap Navigation Close in Mobile View Single Page

  // To close navigation in single page in Bootstrap     $(".navbar-nav li a").click(function () {         if ($('.navbar-collapse').hasClass("in")) {             $('.navbar-collapse').addClass("collapse");             $('.navbar-collapse').removeClass("in");             $('.navbar-collapse').css('height', 'auto');         }         else {             $('.navbar-collapse').removeClass("collapse");             $('.navbar-collapse').addClass("in");             $('.navbar-collapse').css('height', '0');     ...