The jQuery slide methods slides elements up and down. jQuery comes with three handy methods to create the sliding effect easily :
Category » jQuery
iPad/iPhone detection using JavaScript
every website is designed as a responsive so that it can be visited on any resolution window. But browser does not behave same on all the devices. For that, In CSS, we use media query. But using css, we can’t generate html fully compatible with all the devices.
I wanted to post another useful snippet of code for iPad/iPhone detection using javascript
find last position of a substring into a string
Sometimes we need to find last position of a substring into a string. Substring may be a character or a part of a string. Javascript provide us a method
check a substring into a string
Sometimes we need to check the existence of a character or sub-string into a string or find the position of a character or sub-string into a string. Javascript provide us a very simple method :
How to resize colorbox
Sometimes we need to resize colorbox after clicking on sumbit button and we want to show some error or success messages on the same popup window by using javascript or ajax
Add multiple classes in jQuery
Sometime we need to add multiple classes in jQuery. We can achieve it very simply by using jQuery addClass() method.
Change Class using Jquery
The power of jQuery offers many features to web developers. jQuery has addClass(), removeClass() and toggleClass() methods to change class.
//Add a class $('#element').addClass('class_name'); //Remove a class $('#element').removeClass('class_name'); //Remove old class and add new class $('#element').removeClass('old_class').addClass('new_class'); //Or a short way to swap classes $("#element").toggleClass('old_class new_class');
disable fancybox after binding
I am having a strange issue, I have code that pulls content of wordpress posts that was using some plugin to bind fancybox to certain elements on the page. But now I want to implement that fancybox binding from some elements on that page.
Closing colorbox
Colorbox is a jQuery plugin, Nowadays jquery colorbox plugin is mostly used for displaying content in popup window. But there are still somethings where we stuck. Closing colorbox is one of them.
Resizing colorbox iframe using jquery
Once I was in problem of resizing colorbox iframe.
The scenario was that I have opened the colorbox iframe for opening a page and that iframe size was according to that opened page content.