>> $("").appendTo(this).src( src ).load( f );
> if you replace the main line by:
>$("").src( src ).load( f ).appendTo(this);
> then the image will display before the alert() fires.
The problem with appendTo being last is that IE will leak memory if you set
certain attributes (such as
@ John Resig <[EMAIL PROTECTED]> :
> With jQuery 1.0, you should be able to write your plugin like this:
> $.fn.image = function(src, f){
> return this.each(function(){
> $("").appendTo(this).src( src ).load( f );
> });
> };
>
> Helps to make things a little bit simpler.
Yes it works too,
With jQuery 1.0, you should be able to write your plugin like this:
$.fn.image = function(src, f){
return this.each(function(){
$("").appendTo(this).src( src ).load( f );
});
};
Helps to make things a little bit simpler. I like the idea of having
the callback for image loading - a smart mo
I made it work both in Safari and FF by changing the insertion sequence:
$.fn.image = function(src, f){
return this.each(function(){
$("").appendTo(this).each(function(){
this.src = src;
this.onload = f;
});
});
}
$(document).ready(function() {
$("#container").im
> Try swapping the order of the lines above to:
>
> i.onload = f;
> i.src = src;
>
> So that the onload is set before you start loading the image... Not sure
> but that may help?
Nope, it doesn't. In fact the image loads (as I can see from Safari's
"Activity" window), and the alert message pops
Fil wrote:
> @ SDisk SDisk <[EMAIL PROTECTED]> :
>> You can not load images with AJAX simply create a new image object and
>> append, then the image can load asyncronously. Try this simple jQuery
>> plugin:
>>
>> $.fn.image = function(src, f){
>>return this.each(function(){
>>var i = ne
@ SDisk SDisk <[EMAIL PROTECTED]> :
> You can not load images with AJAX simply create a new image object and
> append, then the image can load asyncronously. Try this simple jQuery
> plugin:
>
> $.fn.image = function(src, f){
>return this.each(function(){
>var i = new Image();
>
On 15/08/06, Braveheart <[EMAIL PROTECTED]> wrote:
>
>
> Maybe this is a basic question, but still how can I load images with jquery
> and is there any way to use that little animated .gif that shows that
> somethink is loading with jquery?
> --
> ___
> j
Maybe you need learn some of _javascript_ basics and jQuery notation.The plugin normally is in a separate file, althought you can write the plugincode in your program code:in HTML code: alert("The image is loaded");
});
});
2006/8/15, Braveheart <[EMAIL PROTECTED]>:
I gues
I guess this is what I was looking for.
Anyway I don't know almost anything about javaScript and I started using it
since I found out about AJAX
So can you explain me better for how to implement it?
Here is my example how I tried using it:
$(document).ready(function(){
// The plugin
You can not load images with AJAX simply create a new image object and append, then the image can load asyncronously. Try this simple jQuery plugin:$.fn.image = function(src, f){ return this.each(function(){
var i = new Image(); i.src = ""> i.> this.appendChild(i);
Hey there, have a look at Cody Lindley's thickbox. It sounds like this is more or less what youre after. Im no pro myself, so Im not going to post any code - i might get it wrong :)
http://codylindley.com/_javascript_/257/thickbox-one-box-to-rule-them-allcheerscOn 8/16/06, Braveheart <
[EMAIL PROTE
I stried to use ajax with jquery to load images. Basicly it works but I don't
get the image, instead I get some strange codes from the picture, I guess
because .jpg is a binary file.
Maybe this is a basic question, but still how can I load images with jquery
and is there any way to use that littl
13 matches
Mail list logo