Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 21st, 2004, 08:44 AM
Authorized User
 
Join Date: Sep 2004
Location: ctl, ke, India.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ctranjith
Default Loading Image to Image Control using JavaScript

SIr
 How can I Load an Image to an Image Control using JavaScript

Expecting reply

C T Ranjith

Reply With Quote
  #2 (permalink)  
Old May 28th, 2013, 05:43 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

If the images elements are already in your markup, and they have the src attribute defined, the image files will be downloaded when the page starts loading.

You should either create the image elements programmatically or leave the src attribute empty on your markup, and then assign it when the user clicks next.

You could remove the src attribute of your images, and store it using the $.data function, then in your click event, restore the image src to its original value, for example:

$(function () {
// put a "defaultImage" on all images of gallery
// and store the original src attribute
$('#gallery img').each(function () {
$(this).data('originalSrc', $(this).src).attr('src', 'defaultImage.jpg');
});

$("#next").click(function(){
$('#gallery img').each(function () {
// restore the original src attribute:
$(this).attr('src', $(this).data('originalSrc'));
});
});
});
__________________
(*_*)

Numan
--------------------------------------------------
It is not important what you get But important is  how you got it
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get image size without loading? tal Javascript How-To 3 June 30th, 2007 07:05 AM
image loading abaso.jadhav01 ASP.NET 2.0 Basics 0 October 28th, 2006 01:24 AM
Loading Image through XSL anaik100 XSLT 0 February 15th, 2006 10:23 PM
Problems in Loading Image ctranjith General .NET 0 December 18th, 2004 06:01 AM
Trouble with loading up an image!! HELP!! essex_girl Java GUI 4 October 1st, 2004 03:02 AM



All times are GMT -4. The time now is 04:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.