¡@

Home 

2014/10/16 ¤W¤È 12:03:40

jquery Programming Glossary: hasrun

Ensuring load code fires in jQuery event if attaching event after load occurs

http://stackoverflow.com/questions/2775259/ensuring-load-code-fires-in-jquery-event-if-attaching-event-after-load-occurs

an intermittent issue because sometimes the code is run before the image loads and sometimes its not. function var hasRun false '#image' .bind 'load' function if this .width 0 this .height 0 hasRun return hasRun true do work here .trigger 'load'.. loads and sometimes its not. function var hasRun false '#image' .bind 'load' function if this .width 0 this .height 0 hasRun return hasRun true do work here .trigger 'load' The code looks something like that. I've added the hasRun variable and a.. its not. function var hasRun false '#image' .bind 'load' function if this .width 0 this .height 0 hasRun return hasRun true do work here .trigger 'load' The code looks something like that. I've added the hasRun variable and a check against..