Add repeating CSS selectors
Have you ever needed a way to style the elements of a set ( lets say 5 ) individually, but the same rules to be applied to other set ( of 5 ) ? For example: <div> <h4>first</h4>...
View ArticlejQuery Cycle with carousel thumbs pager
A nice cycle gallery with thumbnail pictures navigation ( like here http://jquery.malsup.com/cycle/pager3.html ), but to use less space, make the thumbnails pager a carousel. ( see a demo here … note,...
View ArticleCustom select input
Using some jQuery and CSS you can make a cross-browser custom select (dropdown) box. <div class="select-wrapper"> <select> <option selected="selected" value="1">Option...
View ArticleJQuery Cycle pager with leading zeros
Adding leading zeros to Cycle’s pager can sometimes make a big visual difference. Using the pagerAnchorBuilder this can be achieved very simple: pagerAnchorBuilder: function(idx, slide) { if (idx <...
View ArticleBxSlider slides counter
Update! Scroll to updated code. Add a slides counter ( current/total ) to bxSlider carousels, using bxSlider callbacks and methods. You just have to add an html element ( ex. ‘<div...
View ArticlejQuery toggle functions
The toggle() method was deprecated in jQuery 1.8 and removed in 1.9. In jQuery 1.9 the toggle() method does not toggle between two or more functions on a click event, it just toggles the visibility of...
View ArticleQuick and simple jQuery accordion
A simple jQuery snippet for those times when you don’t need an entire plugin, but just something quick, and on the spot. <ul class="accordion"> <li> <div class="heading">Lorem ipsum...
View ArticleCheck if page scroll is at bottom
May seem odd to check if the page scroll is at bottom, but can be useful if you need to hide something or show something else, as in a back to top button for example. $('#back-to-top').hide();...
View ArticleRudimentary text expander
There are jQuery plugins, like TextExpander, which work well with portions of text wrapped inside a single element (like a ‘<p>’ tag), but when it comes to collapse block elements, the animation...
View ArticleSlide out hamburger menu
It is known that the slide out menus ( or hamburger menus ) are the best way of making a menu usable for mobile. This method uses jQuery in order to clone the markup of the desktop version menu, and...
View ArticlePrevent bxSlider stop auto
Prevent bxSlider stop auto slides transition, when navigating through slides. $(document).ready(function(){ var slider = $('#slideshow').bxSlider({ auto: true, stopAuto: false, startSlide: 0 });...
View ArticleHide popup when clicking outside
//show popup when clicking the trigger $('#trigger').on('click touch', function(){ $('#tooltip').show(); }); //hide it when clicking anywhere else except the popup and the trigger...
View ArticlePrevent inner elements trigger an event on the parent
Method 1 Stop propagation on inner elements before attaching an event on the parent. $('#parent a').on('click', function(event){ //stop the event bubbling up to the parent event.stopPropagation(); });...
View ArticleRandom start cycle
function randomBox(randomItem) { randomItem = $(randomItem); var random = Math.floor(Math.random() * randomItem.length); randomItem.eq(random % randomItem.length).addClass('active'); function...
View ArticleSimple HTML5 placeholders fallback for IE9 and older
I hoped I will never hear about IE9 and its lack of support for the placeholder attribute, … I had high hopes. I’ve boiled a simple fallback, late in the evening and in a rush, using IE conditional...
View ArticleClear form fields on focus
If you want to make a form without labels for text inputs or textareas, and instead give the fields default values, you will encounter a little annoying problem, when you focus the field to write...
View ArticleCheckbox tree with jQuery
Update: With nothing to do, I remembered the failure with the checkbox tree, and I started re-thinking it. With nothing else on my mind, took me very short time to figure my mistakes; …so now i will...
View ArticleHow to add a class to the current slide in jQuery Cycle
I think that every web developer heard about jQuery Cycle plugin, and we all know that is the most simple to use, and the best regarding the options that it has, but that doesn’t mean is bullet proof....
View ArticleHover effect on the parent of an anchor tag
It ever happened that you need to apply some CSS style to the parent of a link ( anchor tag <a href=””></a> ), when the link is hovered ? For example this HTML: <div> <a...
View ArticlefullPage.js – always scroll from top within sections
Scroll long sections always from top. This works only for section without slides. $('#fullpage').fullpage({ scrollOverflow: true, onLeave: function(index, nextIndex, direction){...
View Article
More Pages to Explore .....