Ajax Updates |
- Gradient : jQuery Plugin
- Image Transitions Manager
- Resizing Thumbnails Script
- Deferred content loading
- mooSocialize – Bookmarks Widget
- Custom form elements
Posted: 30 Aug 2009 09:42 AM PDT It allows you to define a gradient fill and have an element filled with a gradient. You can set the direction of the gradient (right-left or up-down) and the opacity of the gradient easily. It uses the excellent jQuery JavaScript library developed by John Resig at http://jquery.com. View the jquery.gradient.js file for information on settings and some simple examples. How do you clear a gradient? This seems to do it:
What about this instead? I think your version will suffer from performance penalties.
Demo: http://www.parkerfox.co.uk/labs/gradientz Source: http://davidwees.com/myblog/2007/08/gradient_jquery_plugin.html Related Listings:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Posted: 30 Aug 2009 09:24 AM PDT The image transition manager is a javascript library based on scriptaculous and prototype. It supports several image transitions, such as fading, appearing, sliding, growing and shrinking. Because it uses the unobtrusive javascript technique, no inline javascript is needed and hyperlinks still function when javascript is disabled. The image transaction manager features: * 8 (more to come) image transition effects * Visible image preloading * Unobstrusive javascript (no inline javascript in you html-document) * Easy to use Transition object * Corssbrowser: tested in Firefox 2.x, Opera and IE6/7 * No CSS involved See the demo. Cool! How does it work? First of all, since this library is based on based on prototype and script.aculo.us, you have to include these in your html:
After this, include the transition library in your html:
Demo: http://ajaxorized.com/image-transition-manager Download: http://ajaxorized.com/downloads/itm/image_transition_manager.zip Source: http://ajaxorized.com/projects/image-transition-manager-image-transitions-with-scriptaculous/ Related Listings:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Posted: 30 Aug 2009 09:06 AM PDT This tutorial is aimed at controlling the size of the thumbnails appearing on your page. Sometimes we don’t have enough space to spare to fit in large thumbnails and yet we would like to avoid small and barely recognizable images. Using this trick we limit the default dimensions of the thumb, and show it in full size when user mouse-overs it. What we have here is not actual image resizing. It is a resizing of the thumb’s visible area on mouse over. How do we do that? Using overflow property! The overflow property defines the appearance of the content when it overflows the container area. If the container has limited size, for one reason or another, then we use overflow to define what happens. Possible values of overflow property are visible, hidden, scroll and auto. It’s the combination of these values that we will use here and make this trick work. Basically, we will hide a part of the thumbnail when in default state, and show it entirely on mouse over. The Concept The idea behind this is, to place an image into a certain container. Since we’re talking about thumbnails that container would be an tag. We set the size (width and height) of the container to desired values and we set the position property of the container to relative. Image inside has an absolute position. We use negative top and left values to offset the image. Container has overflow set to hidden so only a part of the image that is placed inside the container’s actual area will be visible. The rest of it will be hidden. On a:hover we set the container’s overflow to visible, and reveal entire image. The Code This trick can be used for thumbnail lists or single thumbnails, as shown on the demo page. For markup we use standard tags
Definition of the default state for thumbnails would be something like this:
Now, when user mouse-overs it we set the overflow to visible:
Demo: http://cssglobe.com/lab/overflow_thumbs/ Download: http://cssglobe.com/lab/overflow_thumbs/overflow_thumbs.zip Source: http://cssglobe.com/post/1305/create-resizing-thumbnails-using-overflow-property Related Listings:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Posted: 30 Aug 2009 02:37 AM PDT When rolled into the page life cycle of an ASP.NET WebForm, that red bar is one of your application's greatest enemies. No matter how well you optimize the rest of the page, even one slow task can become the sole factor determining a user's perception of the entire page's performance. In this post, I'm going to show you one way to circumvent that problem. By placing ancillary content in user controls and delaying their load until the core page content has been displayed, you can drastically improve perceived performance. When broken down into digestible chunks, the technique is easy to implement and lends your application a level of polish that your users are sure to appreciate. The four steps required to accomplish this will be: building the user control, statelessly rendering the control as HTML, providing progress indication, and using ASP.NET AJAX to request and inject that HTML. Building the user control First, we need some slow-loading, auxiliary content to encapsulate in a user control. For this example, that's going to be a minimal RSS feed reader widget that displays the most recent posts from this site. The key activity here is retrieving my RSS feed and querying it for some basic information. To expedite this, I'm going to use one of ASP.NET 3.5's great new features: LINQ to XML. LINQ really makes short work of this normally tedious task. It still blows me away every time I use it.
The ListView comes in especially handy for our purposes here, because it gives you such effortless control over the rendered HTML. When injecting generated HTML into a page, you really appreciate knowing exactly what markup to expect. Rendering the user control as HTML The next step is to create a web service that statelessly renders our user control as an HTML string. By statelessly, I mean that we need to render this user control outside the context of an active ASP.NET Page instance, where user controls are normally intended to be used. To solve that problem, you can create a temporary instance of the ASP.NET Page class, dynamically add the user control to it, and then execute it within the web service's context. Doing this turns out to be easier than it is to accurately describe:
However, since our Page instance is created outside of the normal ASP.NET HTTP pipeline and only contains one control, the overhead is negligible. The Page itself is fairly performant compared to all of the other work involved in a typical HTTP round-trip. Setting up the demonstration page To demonstrate, we'll need a page with some fast-loading content to provide contrast. Inside that, we can embed an empty DIV which will be used to accurately inject the user control's rendered HTML.
Progress indicator displayed while the user control loadsWhat this does is give us a bit of rudimentary progress indication. Until we update it later, it will display an empty placeholder with an indicator. You and I know that it's a bit of a scam, but your users will never realize the progress indicator isn't real. I won't tell if you won't! Calling the web service from JavaScript Now that we've got a place to inject it, the final step is to retrieve the HTML rendering of our user control and insert it into the page. ASP.NET AJAX takes all of the hard work out of this step:
Since it's only a CSS class, disabling the progress indication is as simple as using removeCssClass to remove it from the DIV. For more on removeCssClass, check out my recent article about ASP.NET AJAX's client side UI methods. With the animated background removed, we are now free to insert the rendered HTML into the DIV's innerHTML. The end result is exactly the same as if we had placed the user control inside that DIV, without unnecessarily delaying the entire page load. Conclusion I think you'll find that this technique is very powerful. It allows you to leverage your existing knowledge of ASP.NET and its server controls as a robust templating solution for lightweight AJAX. At the same time, it exudes the kind of professional usability that typically requires more tedious and less maintainable client side coding. Note that there is not an UpdatePanel anywhere on this page. Using this technique does not require relying on partial postbacks. Not only does that improve performance, but also allows UpdatePanels elsewhere on the page to operate normally, while the deferred content loads. Demo: http://encosia.com/2008/02/05/boost-aspnet-performance-with-deferred-content-loading/ Download: http://encosia.com/source/uc-delay-load.zip Source: http://encosia.com/2008/02/05/boost-aspnet-performance-with-deferred-content-loading/ Related Listings:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mooSocialize – Bookmarks Widget Posted: 30 Aug 2009 02:17 AM PDT Based on ajax, this small widget allows to integrate many many bookmarks for every post on your blog, website etc. By clicking the mooSocialize button, a window will appear, which lets you choose your favorite network. Having a thumbnail of each service beside the link, it’s easy to see and find the one of your liking. But that’s not all – it doesn’t redirect you to that page, but opens up the page in a hovered layer. Convenient and easy. On top of the opened layer is a small “x”, which allows to close the window later on. Now it is possible to enter an email address of your friend, wife, collegue or whoever should receive information about the page you are actually visiting. Just enter the email address of that person and the rest is done for you. It even sends a screenshot of the site within the mail, so your pal can see upfront where you want to send him/her to. Uses the PHP mail() function, so it should work out on most servers. BASIC STEPS Copy the images folder to your root folder. Place the included mootools12.js and the moosocialize.js into your js directory. Put the included css file into your css directory. If your paths differ, adapt the next lines to match your directory structure. INSTALLATION STEPS Open the page you want mooSocialize to be used. Now add these lines to the head section of your site:
Now choose a place to add the mooSocialize image to, and add this line of code:
The title of the site you are using this and the url are automatically determined as soon as you click and try to submit the actual website to a bookmark service. If a page opens in a new window, then this page disallows being displayed in an iframe. There's nothing to do about. Demo: http://www.artviper.net/moosocialize.php Download: http://www.artviper.net/images/downloadbtn.gif Source: http://www.artviper.net/moosocialize.php Related Listings:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Posted: 29 Aug 2009 08:31 AM PDT This JavaScript and CSS will allow you to use custom images for checkboxes, radio buttons and select lists. Checkboxes, Radio Buttons, Select Lists, Custom HTML Form Elements Have you ever wanted to use your own images for checkboxes, radio buttons or select lists? This script will let you do that. Easily. The unobtrusive script gracefully degrades, so if JavaScript is disabled, normal form input objects appear instead of your customized elements. This works flawlessly in Firefox, Safari, Internet Explorer 7, Opera and others. In Internet Explorer, the select lists are unstyled, but the checkboxes and radio buttons still look and function beautifully. It’s this easy:
Usage You are free to share, alter and use this script commercially. Just leave the title, my name and website in tact in the JavaScript script. This script is licensed under a Creative Commons license. How does it work? In a nutshell, the JavaScript looks for any form element with class="styled" declared; hides the real element; sticks a span tag with a CSS class on it next to the element; and, finally, mouse events are added to the span that handles the stages when it is clicked. To get the checkboxes, radio buttons and select boxes to work properly, you'll need to change three variables in the script: checkboxHeight, radioHeight and selectWidth on lines 21-23. If you use the images I created, you won't have to change the variables, but if you make your own, chances are you'll have to. The checkboxes and radio buttons to the right are linked to transparent PNG images for you to use freely if you'd like. The frist two variables are the height of a single stage of the checkbox and radio button, and the third is the width of the select box. You may need to spend a little time tinkering with the checkbox and radio button images so they don't twitch during different stages.
The CSS If you make your own images, you may need to change a few things in the cascading style sheet. In span.checkbox and span.radio, the height property should be one fourth of the height of the full size images. You also might have to change the width property in span.select selector. You probably won't have to edit any other portions of the CSS, but regardless, this part is still straight forward.
The XHTML The script won't customize checkboxes, radio buttons or select lists unless you declare the styled class. Simply add class="styled" to any checkbox, radio button or option list and the JavaScript and CSS will take over from there.
Demo: http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/example/ Download: http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/custom-form-elements.js Source: http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/ Related Listings:
|
You are subscribed to email updates from Ajax Updates To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.