jQuery Back Button

This is a jQuery code snippet to simulate a back button based on the users last web page. $(function(){} $(‘.back’).click(function(){ parent.history.back(); return false; }); }); This will trigger Back button on all elements with the class name “back”. If you would like to specify an element just use the element name $(‘#back’).click(function() If you would…Continue reading jQuery Back Button

A Beautiful Document Presentation Using HTML,CSS & jQuery

Today, I had to create a document presentation. Usually I select Microsoft Powerpoint or Google Presentation to make the presentation. This time, I went ahead and created my own document presentation template using HTML, CSS and jQuery. I want to share it here. The demo can be found below I had the basic idea of…Continue reading A Beautiful Document Presentation Using HTML,CSS & jQuery

How to center an element using jQuery

A simple function can be used to set elements in the center dynamically. [javascript] jQuery.fn.center = function () { this.css(‘position’,’absolute’); this.css(‘top’, ( $(window).height() – this.height() ) / +$(window).scrollTop() + ‘px’); this.css(‘left’, ( $(window).width() – this.width() ) / 2+$(window).scrollLeft() + ‘px’); return this; } [/javascript] This can be called using [javascript] $(function(){ $(“#a”).center(); }); [/javascript] Where…Continue reading How to center an element using jQuery