background preloader

AJAX

Facebook Twitter

Simple Way to Random Display or Rotate Content Using JavaScript and CSS. In a project I did recently there was a need for randomly displayed content in form of one of those "Did you know" tips. There were 8 to 10 paragraphs of text and client wanted to display just one randomly chosen. Since that was the static site I decided to go with front end solution. I am aware that there are many more elegant back-end solutions but read on and you’ll see that there are advantages to this as well. Download the script files Take a look at the randomly displayed content demo Take a look at randomly rotating content demo Let’s Get Started So first the markup. <ul id="tips"><li>... if you want to become a better coder you need to eat your vegetables?

The idea is to HIDE all of the tips and then display randomly chosen one using JavaScript. So to style and hide the tips we use the following CSS code: To display one of them randomly we will use small jQuery script. Below that add the following script: Short one isn’t it. Taking it One Step Further. Create a Realistic Hover Effect With jQuery | Blog and Web Design Portfolio of Adrian Pelletier. For one of the projects I’m currently working on with Rareview, we wanted to add a rising hover effect to a set of icon links. Using jQuery’s animate effect, I experimented with icons that have reflections and others with shadows.

Here is a demo with two examples: The HTML and CSS are both straightforward and have a structure and style common to many web navigations and menus (for the sake of post length, I’m not including HTML/CSS code examples here but you are free to snoop around in the demo or view the files in the download below). In a nutshell, the JS appends the reflection/shadow to each <li>, then animates the position and opacity of these elements and the icon links on hover. Please note, for the purposes of this quick demo, I did not bother including support for IE6. View Demo or Download Update 06/01/2009: I updated the shadow example so that it has more of a bounce to it. Update 07/08/2009: As Cody Lindley points out in the comments (thanks!) Nakajima/jquery-glow - GitHub. 21 Best jQuery Tooltip Plugins, Demos, Examples & Tutorials. Today we are posting some attractive, Handy and useful jquery Tooltip plugins for your new projects.

If the tooltip is being used appropriately, it can improve our site’s user friendly level, and also save us a lot of spaces. What is Tooltip ? – It is a Easiest way to show extra/more information when user hovers the cursor over an element. The “hover box” will appear when the mouse hover in, and disappear when the mouse hover out. In this post we have collected 21 best jQuery Tooltip Plugins with Demo , Examples and Tutorials to help with your next project to create User friendly Web Design, hope you will enjoy them! 1.)

This awesome jQuery Tooltip provides supplementary information about that element. This is a very basic example of what a tooltip plugin can do. Build a Better Tooltip with jQuery Awesomeness – Demo 2.) The information is requested via AJAX, so you don’t have to include all of this extra information in a hidden div. jQuery Ajax Tooltip 3.) 6.) qTip jQuery Plugin 7.) 8.) 9.)

FILE UPLOAD

30+ Brand New jQuery Plugins To Change the Look and Feel of Your Website. Enabling the Back Button. Watch Watch Enabling the Back Button screencast (Alternative flash version) QuickTime version is approximately 50Mb, flash version is streaming. View the demo used in the screencast The Problem Using our original jQuery tabs solution, we have a tabbing system that you can click the tabs and different content loads. However, when I hit the back or forward buttons, the web page navigates completely away from the site. We want to fix this, so that I can navigate the tabs using the browsers native back and forward buttons. “Cowboy” Ben Alman’s BBQ Ben wrote a jQuery plugin called BBQ. Now, in retrospect, I think that I only need Ben’s hashchange plugin as that’s all I ended up using in the screencast, but none the less, they’re both worth checking out. Now armed with Ben’s plugin, we’re going to refactor the tab code so that the back button works.

Solution The way the existing tabs work is as follows: #1. This process was our original code, and most of it needs to stay in place. $('a[hash=#first]') AJAX - Noupe. 10 AJAX-based & PHP WebMail Clients For a Great User Experience Employees need to access their email from wherever they happen to be – on the road, at customer sites, remote offices, and at home. WebMail clients allows receiving and sending email messages using POP3 and SMTP protocols through both local and remote mail servers. Providing secure filtering of unsafe content while viewing HTML-formatted email messages. WebMail clients can operate under different popular web platforms (PHP, ASP.NET, ruby on rails, java).

Read more. Calendar: a Javascript class for Mootools that adds accessible and unobtrusive date pickers to your form elements. jQuery.suggest plugin. Installation Simply include src/jquery.suggest.js in your HTML and you are good to go. npm Since version 1.2.0 you can also install jquery.suggest via npm: npm install jquery-suggest Usage Markup Javascript Setting the suggestionColor setting is optional. MoreIndicatorClass (default: suggest-more) can be used to style the small indicator, appearing when the plugin has found more than one suggestion. Alternative HTML content for this indicator can be supplied using the moreIndicatorText (default: &hellip;) option Demo (Start typing the name of a programming language…) License Copyright (c) 2012 Florian Plank ( Download the source.

Live Table Edit with Jquery and Ajax. I love Jquery framework, feels that we can do awesome things. Let’s take a look at how to implement live table edit with Jquery and real time database update using Ajax. This is an interesting concept playing with DOM objects. You know that majority of readers had requested this tutorial, hope you guys like it! Download Script Live Demo Database Sample database fullnames table columns id, firstname and lastname. CREATE TABLE fullnames (id INT PRIMARY KEY AUTO_INCREMENT,firstname VARCHAR(70), lastname VARCHAR(70) ); TableEdit.php Displaying records from fullnames table. //Table Records<table><? <td class="edit_td"><span id="last_<? Javascript Code Contains javascipt code.

$(".edit_tr").click(function(){}- edit_tr is the CLASS name of TR tag. If(first.length>0&& last.length>0) { // Edit input box click action $(".editbox").mouseup(function() {return false }); // Outside click action $(document).mouseup(function() { $(".editbox").hide(); $(".text").show(); }); });</script> jQuery API. Description: Creates DOM elements on the fly from the provided string of raw HTML. Creating New Elements If a string is passed as the parameter to $(), jQuery examines the string to see if it looks like HTML (i.e., it starts with <tag ...

>). If not, the string is interpreted as a selector expression, as explained above. But if the string appears to be an HTML snippet, jQuery attempts to create new DOM elements as described by the HTML. Then a jQuery object is created and returned that refers to these elements. For explicit parsing of a string to HTML, use the $.parseHTML() method. By default, elements are created with an ownerDocument matching the document into which the jQuery library was loaded. If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's innerHTML mechanism. Filtering isn't, however, limited to these tags.

Tags that cannot contain elements may be quick-closed or not: JavaScript and jQuery: 50 New Tutorials. jQuery page scrolling. Over a year ago I wrote an article on scrolling a page using Prototype, just to update things here I’m going to run through scrolling a page using jQuery and the animate() function. Automated page scrolling is useful in many cases. A good example of this technique can be found in the personal project i worked on a few months back ‘We Deliver’ which you can find here. The page scroll in this project was particularly important as it’s a single page site in that all the content and animation happens within a single user experience. The Code It’s extremely easy to get started using jQuery scroll. First we need to declare the element that the vertical scrollbar uses as it’s reference so in other words we want to scroll the main html body window for example.

The next line is saying scroll to the element defined (in this case the element .bottom) we’re not defining an offset so it takes the top of the element. JQuery- Auto Refresh Div Every X Seconds. I’ve recently been working on a e-commerce site (online store) for a client. One of the features required was to show the most recently viewed items on the homepage. For that to work, I need to write a script to query a DB every 10secs or so. Youtube actually has something similar, where on the homepage they display “videos that are being viewed now”. I don’t know how they do, but this is how I do it… Obviously it’s an AJAX affect; as always, I’ll be using the JQuery library (my personal favourite). Here’s the OUTDATED code (find updated code below this example)… As you can see, the JS code in the header is calling a file called response.php.

It’s as easy as that. If anyone uses the code, let me know how you get on UPDATE- Load content immediately on page load & I.E Fix I’ve had a LOADS of people emailing us asking how to get the content in the data.php file to load immediately on pageload, and then start the refreshing process. 28 Fresh jQuery Tutorials - Web Design Blog – DesignM.ag. Get the FlatPix UI Kit for only $7 - Learn More or Buy Now In this post we have collected 28 fresh and useful jQuery tutorials. If you like jQuery tutorials you might also want to check out some of our previous posts below.

Enjoy! 20 Useful jQuery Slider Tutorials 25 jQuery Tutorials for Improved Navigation Menus Easy Display Switch with CSS and jQuery Create an Image Rotator with Description (CSS/jQuery) Update: We also have a few more recent jQuery tutorials you might want to check out.How to Build an Image Slideshow UI Switcher with jQueryHow to Build an iOS Style Content Slider Using jQuery How to Create a jQuery Confirm Dialog Replacement How to Make Auto-Advancing Slideshow Fullscreen Gallery with Thumbnail Flip Making Google’s Christmas Doodle with jQuery Thumbnails Preview Slider with jQuery Sweet Thumbnails Preview Gallery Animated Form Switching with jQuery Parallax Slider with jQuery Portfolio Zoom Slider with jQuery Bubbleriffic Image Gallery with jQuery Overlay Effect Menu with jQuery.

Harmony. CSS3 @font-face Design Guide. Although CSS3 @font-face is supported by most major browsers (IE, Firefox, Chrome, and Safari), but not all. When it doesn't, your custom fonts might break the layout or come out with undesired results. In this article, I will explain the common issues with using custom fonts, picking the matching fallback web safe fonts, and how to create a perfect fallback font style with Modernizr.

Common Mistake One common mistake that most people make when implementing custom fonts is not specifying the fallback fonts or picking the wrong fallback fonts. Web Safe Fallback Fonts When using custom fonts, it is important to include the web safe fonts as fallback. The fallback font helps to keep your design looking consistent when @font-face is not supported or available. Layout Issues Because every font face has its own width, height, weight, kerning (letter-spacing), etc., some fonts are not substitutable with the web safe fonts. Modernizr Fallback Font Styles With Modernizr (demo) Including Modernizr. All About jQuery: Plugins, Tutorials and Resources. Oct 15 2010 In this post, we are presenting a bunch of exciting and awesome jQuery plugins for your use.

As we all know very well that jQuery is the most famous Javascript framework available out there which comes with many amazing features and is quite easy to be used. You can use these plugins to add beautiful effects and functionality in your next project. These plugins will also help you in completing your task easily. jQuery Menu and Navigation Collapsing Site Navigation with jQuery ( Demo | Download ) Creating a collapsing menu that contains vertical navigation bars and a slide out content area. Beautiful Background Image Navigation with jQuery ( Demo | Download ) A beautiful navigation that has a background image slide effect.

Slot Machine Tabs ( Demo | Download ) Three columns in each content box rotate like a slot machine to reveal the content in the next content box when a new tab is clicked. Stylish Navigation Men ( Demo | Download ) A stylish CSS + XHTML navigation menu. Ajax Autocomplete for jQuery. About jQuery Autocomplete allows you to easily create autocomplete and autosuggest boxes for text input fields. Built with focus on performance - results for every query are cached and pulled from local cache for the same repeating query. If there are no results for particular query it stops sending requests to the server for other queries with the same root. What's new $('#query').autocomplete(options) now returns an Autocomplete instance only for the first matched element. Autocomplete functionality can be disabled or enabled programmatically. var ac = $('#query').autocomplete(options); ac.disable(); ac.enable(); Options can be changed programmatically at any time, only options that are passed get set: If you need to pass additional parameters, you can set them via setOptions too: New parameters when initializing autocomplete.

Var reEscape = new RegExp('(\\' + ['/', ' Installation Include jQuery in your header. How to use Here is an Ajax Autocomplete sample for the text field with id "query" Easy. Animated Content Menu with jQuery. Today we will create a slick animated content menu with jQuery for a restaurant theme. The menu items will be animated and when clicked, a content area with more information will appear. Also, he background image is going to change according to which menu item was clicked. The main idea is to […] View demoDownload source Today we will create a slick animated content menu with jQuery for a restaurant theme.

The main idea is to have a restaurant menu with the different menu categories displayed. So, let’s get started. The Markup The HTML structure is going to contain some elements for the background image, the grid overlay, the loading icon and the main menu. As a default background image when the page loads, we will have the image Default.jpg.

The menu content will be wrapped by a div with the class “ac_content”. For each menu item, we will have a div “ac_subitem” which will contain the submenu content box. Let’s take a look at the style. The CSS @import url('reset.css'); The JavaScript. 35 jQuery Tutorials You Must Know.