Showing loading for ajax content is pretty common thing but suppose there is a quite big image (in size) on your page and it is taking lots of time to load. Would it not be nice to show loading icon for the same? Well, it creates a nice user experience. The user will come to know that something is loading. So in this post, I will show you how to show loading icon while actual image is loading using jQuery.
In this blog i'm posting some Asp.net,Sql Server,Jquery,HTML-5,sqlite,C#,JavaScript scripts and sample codes that i found and created by me or my friends with a mind that it Save/ Help our ass some ways...
Showing posts with label Image. Show all posts
Showing posts with label Image. Show all posts
Tuesday, July 3, 2012
Monday, July 2, 2012
Spin plugin to show loading icon with jQuery
Hi *.*,
Web pages takes time to load and when page is heavy then it takes more time to load. Would it not be nice to show loading icon. It creates responsive webpage and gives nice user experience.In this post, I will show you a plugin to show loading icon.
Features
No images, no external CSS
No dependencies (jQuery is supported, but not required)
Highly configurable
Resolution independent
Uses VML as fallback in old IEs
Uses @keyframe animations, falling back to setTimeout()
Works in all major browsers, including IE6
MIT License
How to use it?
var opts = {
lines: 13, // The number of lines to draw
length: 7, // The length of each line
width: 5, // The line thickness
radius: 21, // The radius of the inner circle
rotate: 90, // The rotation offset
color: '#000', // #rgb or #rrggbb
speed: 2, // Rounds per second
trail: 93, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: 'auto', // Top position relative to parent in px
left: 'auto' // Left position relative to parent in px
};
var target = document.getElementById('foo');
var spinner = new Spinner(opts).spin(target);
The spin() method creates the necessary HTML elements and starts the animation. If a target element is passed as argument, the spinner is added as first child and horizontally and vertically centered.
Manual positioning
By default the spinner is centered within the target element. Alternatively you may specify a top and left option to position the spinner relative to the target element.
Hiding the spinner
To hide the spinner, invoke the stop() method, which removes the UI elements from the DOM and stops the animation. Stopped spinners may be reused by calling spin() again.
Browser Compatibility
Chrome
Safari 3.2+
Firefox 3.5+
IE 6,7,8,9
Opera 10.6+
Mobile Safari (iOS 3.1+)
Android 2.3+
Download Plugin : http://fgnass.github.com/spin.js/dist/spin.min.js
If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)
Web pages takes time to load and when page is heavy then it takes more time to load. Would it not be nice to show loading icon. It creates responsive webpage and gives nice user experience.In this post, I will show you a plugin to show loading icon.
Features
No images, no external CSS
No dependencies (jQuery is supported, but not required)
Highly configurable
Resolution independent
Uses VML as fallback in old IEs
Uses @keyframe animations, falling back to setTimeout()
Works in all major browsers, including IE6
MIT License
How to use it?
var opts = {
lines: 13, // The number of lines to draw
length: 7, // The length of each line
width: 5, // The line thickness
radius: 21, // The radius of the inner circle
rotate: 90, // The rotation offset
color: '#000', // #rgb or #rrggbb
speed: 2, // Rounds per second
trail: 93, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: 'auto', // Top position relative to parent in px
left: 'auto' // Left position relative to parent in px
};
var target = document.getElementById('foo');
var spinner = new Spinner(opts).spin(target);
The spin() method creates the necessary HTML elements and starts the animation. If a target element is passed as argument, the spinner is added as first child and horizontally and vertically centered.
Manual positioning
By default the spinner is centered within the target element. Alternatively you may specify a top and left option to position the spinner relative to the target element.
Hiding the spinner
To hide the spinner, invoke the stop() method, which removes the UI elements from the DOM and stops the animation. Stopped spinners may be reused by calling spin() again.
Browser Compatibility
Chrome
Safari 3.2+
Firefox 3.5+
IE 6,7,8,9
Opera 10.6+
Mobile Safari (iOS 3.1+)
Android 2.3+
Download Plugin : http://fgnass.github.com/spin.js/dist/spin.min.js
If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)
Sunday, April 15, 2012
Deleting a file from the server
hi Everybody,
Some times v may have to replace our old file ( what b the file format) with new one.Just like updating Bio in a job Portal an example. for that v need to find whether it exist a file On that name if v find. v need to delete it.Some server will done this job automatically some times it may throw an error "Access denied".So let's don't take that risk :)
Friday, September 16, 2011
Binding or display image having zoom effect from folder
Hi *.*,
As a continuation of my previous post. Now i'm binding images from folder.
Code
private class ImageFileInfo
{
public string FileName { get; set; }
}
public void limage()
{
string imgFolder = HttpContext.Current.Request.PhysicalApplicationPath + @"img\";
string[] fileEntries = Directory.GetFiles(imgFolder);
List<ImageFileInfo> mylist = new List<ImageFileInfo>();
foreach (string fName in fileEntries)
{
string d = System.IO.Path.GetFileName(fName);
mylist.Add(new ImageFileInfo { FileName = d });
}
dtagrid.DataSource = mylist;
dtagrid.DataBind();
}
On HTML
<asp:DataList ID="dtagrid" runat="server" RepeatColumns="5" RepeatDirection="Horizontal">
<ItemTemplate>
<li><a href='img/<%# Eval("FileName") %>'>
<img src='img/<%# Eval("FileName") %>' alt="" /></a></li>
</ItemTemplate>
</asp:DataList>
Stay Tune...
Have a nice day... 'N happy Coding :)
Subscribe to:
Posts (Atom)