background preloader

Slide Elements in Different Directions

Slide Elements in Different Directions
Although jQuery has a nice set of slide methods — .slideDown(), .slideUp(), and .slideToggle() — sometimes we may want to slide an element in a different direction. Fortunately, it's pretty easy to do. Reverse the Slide Direction With the built-in slide methods, elements are shown by sliding them down and into view. <div id="slidebottom" class="slide"> <button>slide it</button> <div class="inner">Slide from bottom</div></div> To get the inner div to slide up, we'll anchor its bottom edge to the bottom of the bottom of the nearest positioned ancestor (in this case, the #slidebottom div): Other properties such as width, padding, margin, and background-color have been set for these elements, but only the essential properties for modifying the slide behavior are shown above. Note: I'll be using the term positioned to refer to elements that have the CSS position property set to something other than "static." Now, we can write the jQuery the same way we would with a traditional slide effect:

Suckerfish Dropdowns A note from the editors: While innovative for its time, this article no longer represents modern best practices. “DHTML” dropdown menus have notoriously involved nasty big chunks of JavaScript with numerous browser-specific hacks that render any otherwise neat, semantic HTML quite inaccessible. Oh, the dream of a lightweight, accessible, standards-compliant, cross-browser-compatible method! Enter Suckerfish Dropdowns. Meet the markup#section1 Article Continues Below To start, we should use the best method for defining a navigation menu — a list. Quite straightforward really — nice and neat HTML that, as a result, is highly accessible. Styling it#section2 To get started, all of the lists need to be jigged around a bit — namely, the padding and margin set to zero and the list-style set to none: Now we need to transform the first-level list into a horizontal menu bar. The next step is to tackle the second-level lists that will be the dropdowns themselves: And now, making the sucker work.

Responsive Mobile Menu 12 Wesbite to Learn jQuery Jquery is a great way to get a lot of cool things to happen on your website. You must take the time to learn it, in this post I give you 12 Wesbites to Learn jQuery. This is just to get your feet wet its always best to take a class or pick up a book. jquery-mix.com jqueryfordesigners.com 15daysofjquery.com jqueryking.com addyosmani.com docs.jquery.com tutorialzine.com visualjquery.com jquerystock.com developphp.com jquerystyle.com marcgrabanski.com

Simple JavaScript Inheritance I’ve been doing a lot of work, lately, with JavaScript inheritance – namely for my work-in-progress JavaScript book – and in doing so have examined a number of different JavaScript classical-inheritance-simulating techniques. Out of all the ones that I’ve looked at I think my favorites were the implementations employed by base2 and Prototype. I wanted to go about extracting the soul of these techniques into a simple, re-usable, form that could be easily understood and didn’t have any dependencies. Additionally I wanted the result to be simple and highly usable. Here’s an example of what you can do with it: A couple things to note about this implementation: Creating a constructor had to be simple (in this case simply providing an init method does the trick).In order to create a new ‘class’ you must extend (sub-class) an existing class.All of the ‘classes’ inherit from a single ancestor: Class. Simple Class Creation and Inheritance Initialization Super Method

7 Best Websites to Step-by-Step Learn jQuery jQuery has recently become the most popular and flexible Javascript Library that have added a lot of ease and efficiency for web developers and web designers. With it’s growing popularity it has become inevitable for everyone developer to learn this very language. jQuery is a fast, concise and easy to comprehend javascript library that simplifies complex task like HTML document traversing, Ajax interactions, animating, and event handling. It eases client-side HTML scripting. jQuery was released in January 2006 by John Resig with an Open Source license. jQuery is being used by 43% of the top 10,000 sites and thus you can estimate the growing popularity among developers. jQuery Understanding jQuery shouldn’t be much of a hassle for the web developers who are already into the business and have successfully created projects using css and html but for beginners this task can seem to be a tedious job, especially when they don’t know where to start from and what are the reliable resources.

Custom Selectors - jQuery Select all elements that are in the progress of an animation at the time the selector is run. Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-). Selects elements that have the specified attribute with a value containing the a given substring. Selects elements that have the specified attribute with a value containing a given word, delimited by spaces. Selects elements that have the specified attribute with a value ending exactly with a given string. Selects elements that have the specified attribute with a value exactly equal to a certain value. Select elements that either don’t have the specified attribute, or do have the specified attribute but not with a certain value. Selects elements that have the specified attribute with a value beginning exactly with a given string. Selects all button elements and elements of type button. Selects all elements of type checkbox.

JavaScript Inheritance Patterns | David Shariff | Front End User Interface Engineer In this post, I am going to introduce to you 3 different ways of how you can implement inheritance in JavaScript. You will see inheritance implemented in languages such as Java by allowing a class to inherit state and behavior from a superclass, where each superclass can have many subclasses. This means that in Java an object is an instance of a class, which can inherit other classes. Now in JavaScript, being prototypal by nature, an object can inherit from an object. For the rest of this post, I will introduce the Pseudoclassical, Functional and Prototypal inheritance patterns in JavaScript. Pseudoclassical pattern The Pseudoclassical pattern tries to replicate inheritance in a way that is familiar to those who come from a Java or C like background. A pattern which uses a constructor function and the new operator, combined with a prototype added to the constructor is said to be Pseudoclassical. In JavaScript, one way to do this inheritance is: Functional pattern Prototypal pattern Summary

How to Get IE8 to Support HTML5 Tags and Web Fonts - tatiyants.com Internet Explorer has long been the bane of web developer’s existence, largely due to its limited and buggy support for standards. Though things improved some in IE9, it doesn’t yet have the market share that would allow you to ignore its older siblings. And while it’s debatable whether you need to worry about IE7 (I don’t), IE8 is popular enough to demand attention. The good news is that it’s possible to get IE8 to do decent things with modern web technologies. In this post, I’ll focus on two: HTML5 tags and Web Fonts. HTML5 Elements HTML5 has a whole bunch of new elements for adding semantic meaning to your pages. Since IE8 doesn’t know anything about these, it won’t recognize styles applied to them via CSS. Another important thing to point out is that HTML5 elements are displayed as block by default, but IE8 doesn’t know that either. Note that if you’re using an HTML5 aware reset stylesheet (like this one), this is probably already taken care of for you. Web Fonts References: tagged with:

CSS selectors jQuery Select all elements that are in the progress of an animation at the time the selector is run. Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-). Selects elements that have the specified attribute with a value containing the a given substring. Selects elements that have the specified attribute with a value containing a given word, delimited by spaces. Selects elements that have the specified attribute with a value ending exactly with a given string. Selects elements that have the specified attribute with a value exactly equal to a certain value. Select elements that either don’t have the specified attribute, or do have the specified attribute but not with a certain value. Selects elements that have the specified attribute with a value beginning exactly with a given string. Selects all button elements and elements of type button. Selects all elements of type checkbox.

Related: