I have several buttons, when you click on one of them, that show an image. The problem is: the images load before clicking on them. I want to load images, after clicking on a button. How to do that?
I know, but all of the files load at first. Why to use start loading onClick for a loaded item? I want to prevent jquery from loading an image at first.
@Mottie: Wow. I think I'll learn a lot about html5 :(o) But, actually this is can be modified. No longer use the <button>, but using <a>. Then add return false; at the end function:
The problem is: the images load before clicking on them. I want to load images, after clicking on a button.
How to do that?
I want to prevent jquery from loading an image at first.
The image isn't on the page until you add it and so it won't load until then.
And you can remove it from the DOM like so:
append('Can a DIV be Here?')
.append()function. It looks like a simple ajax ^_^relattribute valid for<button>? If so, maybe this can be used for load more than one image: http://jsfiddle.net/tovic/x3QdU/ »@Hompimpa, that looks good, but I didn't tried that.
relnot valid for<button>I mean: the rel values
data-*where*is any name without spaces (ref).But, actually this is can be modified. No longer use the
<button>, but using<a>. Then addreturn false;at the end function: