jQuery and Javascript power!

This is just a quick blog today, but I have been messing around with jQuery/AJAX functionality and what not. This is not something that someone else couldn’t do with a couple of minutes of free time to read.

Here is a snippet of code, using jQuery/Javascript to make an image randomly move about in a container. I’m assuming that you have the plugin livequery added into your jQuery script as well.

HTML

#imgShow {
position: relative;
overflow: hidden;
width: 656px;
height: 255px;
}
#imgShow img {
position: absolute;
top: 0;
left: 0;
}
<div id="imgShow"><img src="/images/test.jpg" alt="" /></div>

Javascript:

function timedGallery() {
$("#imgShow img").livequery(function() {
var maxWidth = 656;
var maxHeight = $("#imgShow").height();
var imgHeight = $(this).height();
var imgWidth = $(this).width();
var maxLeft = maxWidth - imgWidth;
var maxTop = maxHeight - imgHeight;
$(this).animate({ left: Math.round(Math.random() * maxLeft), top: Math.round(Math.random() * maxTop) }, Math.round(Math.random() * 8000 + 3500), timedGallery);
});
}

The run down with the above math is actually pretty simple. Math.random() generates a random number between 0 and 1. Then you can multiply by a number to receive a minimum (0) and max (max[left/top]). Basically: Math.round(Math.random() * 8000 + 3500) means, pick a random number between 0 and 11500. In this case, 0 - 11.5 seconds.

That is all for now, hope all is well!

Side note: In the interest of learning, I created a pretty nifty interface for fun. I tested it on Internet Explorer and it fails horribly. But, if you have FireFox, feel free to check it out: http://www.vipersuite.com

148 Responses to “jQuery and Javascript power!”

  1. Alexander Says:

    buy@viagra.online” rel=”nofollow”>…

    Need cheap generic VIAGRA?…

  2. Alexander1 Says:

    buy@aloe.vera.gel” rel=”nofollow”>…

    Need cheap generic VIAGRA?…

  3. Alexander6 Says:

    buy@generic.VIAGRA” rel=”nofollow”>…

    Need cheap generic VIAGRA?…

  4. Alexander7 Says:

    buy@generic.LEVITRA” rel=”nofollow”>…

    Need cheap generic LEVITRA?…

  5. ANGEL Says:

    Order@Coral.Calcium.Online” rel=”nofollow”>..

    Buygeneric pills…

  6. TERRENCE Says:

    Purchase@Discount.Coral.Calcium” rel=”nofollow”>..

    Buyit now…

  7. SALVADOR Says:

    Cheap@Coral.Calcium.Online” rel=”nofollow”>..

    Buygeneric meds…

  8. DUSTIN Says:

    Get@Coral.Calcium.Online” rel=”nofollow”>..

    Buygeneric drugs…

  9. BRANDON Says:

    Buy@Discount.Abana” rel=”nofollow”>..

    Buyno prescription…

  10. PERRY Says:

    Order@Abana.Online” rel=”nofollow”>…

    Buywithout prescription…

  11. EDUARDO Says:

    Cheap@Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>..

    Buygeneric pills…

  12. CHARLIE Says:

    Buy@Discount.Acai” rel=”nofollow”>..

    Buynow it…

  13. SALVADOR Says:

    Cheap@Acai.Online” rel=”nofollow”>…

    Buynow…

  14. WALLACE Says:

    Buy@Generic.Acai.Without.Prescription” rel=”nofollow”>…

    Buygeneric drugs…

  15. ENRIQUE Says:

    Purchase@Generic.Abilify” rel=”nofollow”>.

    Buynow it…

  16. MIKE Says:

    Buy@Cheap.Coral.Calcium” rel=”nofollow”>.

    Buydrugs without prescription…

  17. LEWIS Says:

    Order@Coral.Calcium.Online” rel=”nofollow”>..

    Buynow it…

  18. KURT Says:

    Buy@Acai.Online” rel=”nofollow”>.

    Buywithout prescription…

  19. DENNIS Says:

    Buy@Acai.Online” rel=”nofollow”>.

    Buyit now…

  20. RALPH Says:

    Buy@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  21. SAMUEL Says:

    Buy@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  22. FELIX Says:

    Order@Acai.Online” rel=”nofollow”>…

    Buyit now…

  23. DONALD Says:

    Order@Discount.Acai” rel=”nofollow”>…

    Buyit now…

  24. JACK Says:

    Order@Generic.Acai” rel=”nofollow”>..

    Buydrugs without prescription…

  25. VICTOR Says:

    Order@Acai.Without.Prescription” rel=”nofollow”>.

    Buygeneric drugs…

  26. RICK Says:

    Order@Energy.Boost.Online” rel=”nofollow”>.…

    Buygeneric drugs…

  27. NATHAN Says:

    Order@Discount.Energy.Boost” rel=”nofollow”>.…

    Buynow it…

  28. MATHEW Says:

    Purchase@Cheap.Energy.Boost” rel=”nofollow”>.…

    Buyno prescription…

  29. CARL Says:

    Buy@Accupril.Online” rel=”nofollow”>.…

    Buygeneric meds…

  30. ADAM Says:

    Buy@Discount.Accupril” rel=”nofollow”>.…

    Buyno prescription…

  31. BILLY Says:

    Get@Accupril.Online” rel=”nofollow”>.…

    Buygeneric drugs…

  32. BRUCE Says:

    Order@Cheap.Accutane” rel=”nofollow”>.…

    Buygeneric drugs…

  33. WILLIAM Says:

    Buy@Aciphex.Online” rel=”nofollow”>.…

    Buygeneric pills…

  34. ANDREW Says:

    Cheap@Aciphex.Without.Prescription” rel=”nofollow”>.…

    Buynow it…

  35. BYRON Says:

    Buy@Generic.Aciphex.20mg” rel=”nofollow”>.…

    Buynow it…

  36. RODNEY Says:

    Buy@Actonel.35mg” rel=”nofollow”>..

    Buygeneric drugs lzt…

  37. DARYL Says:

    Purchase@Generic.Actonel.35mg” rel=”nofollow”>..

    Buygeneric drugs krg…

  38. VICTOR Says:

    Get@Actoplus.Met.Online” rel=”nofollow”>..

    Buygeneric pills zdg…

  39. RAY Says:

    Buy@Actos.Online” rel=”nofollow”>.

    Buygeneric drugs zfk…

  40. BRANDON Says:

    Buy@Generic.Actos” rel=”nofollow”>..

    Buygeneric drugs eet…

  41. SERGIO Says:

    Buy@Actos.Without.Prescription” rel=”nofollow”>.

    Buyno prescription luw…

  42. CLIFTON Says:

    Order@Acular.Online” rel=”nofollow”>..

    Buygeneric meds qmo…

  43. ALEJANDRO Says:

    Order@Adalat.Online” rel=”nofollow”>..

    Buygeneric meds qhr…

  44. MARCUS Says:

    Buy@Advair.Online” rel=”nofollow”>..

    Buynow it vhx…

  45. TIM Says:

    Cheap@Generic.Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>.

    Buywithout prescription yyn…

  46. JERRY Says:

    Buy@Acai.Online” rel=”nofollow”>…

    Buydrugs without prescription vrg…

  47. MARION Says:

    Order@Cheap.Acai” rel=”nofollow”>..

    Buyno prescription gdt…

  48. RONALD Says:

    Buy@Acai.Without.Prescription” rel=”nofollow”>.

    Buygeneric drugs itj…

  49. JOEL Says:

    Generic@Acai.500mg.Without.Prescription” rel=”nofollow”>..

    Buyno prescription wkp…

  50. CHRISTOPHER Says:

    Buy@Energy.Boost.Online” rel=”nofollow”>..

    Buynow it cey…

  51. LEWIS Says:

    Order@Energy.Boost.Online” rel=”nofollow”>.

    Buygeneric drugs axm…

  52. MITCHELL Says:

    Purchase@Energy.Boost.Online” rel=”nofollow”>..

    Buydrugs without prescription faj…

  53. BRETT Says:

    Cheap@Energy.Boost.Online” rel=”nofollow”>…

    Buydrugs without prescription jlg…

  54. BRUCE Says:

    Get@Energy.Boost.Online” rel=”nofollow”>..

    Buyno prescription jui…

  55. BRUCE Says:

    accupril@and.muscle.pain” rel=”nofollow”>…

    Buynow it zdg…

  56. AUSTIN Says:

    Order@Cheap.Accupril” rel=”nofollow”>.

    Buynow it fnp…

  57. GERARD Says:

    Get@Accupril.Online” rel=”nofollow”>..

    Buyit now irl…

  58. LEROY Says:

    Order@Accutane.Online” rel=”nofollow”>…

    Buyit now sge…

  59. MARION Says:

    Order@Discount.Accutane” rel=”nofollow”>.

    Buygeneric drugs mby…

  60. JASON Says:

    Purchase@Cheap.Accutane” rel=”nofollow”>…

    Buywithout prescription ccw…

  61. DALE Says:

    Buy@Generic.Aciphex.Without.Prescription” rel=”nofollow”>…

    Buyit now knc…

  62. JOHNNY Says:

    Buy@Cheap.Acomplia” rel=”nofollow”>…

    Buygeneric meds svb…

  63. DUANE Says:

    Purchase@Discount.Acomplia” rel=”nofollow”>..

    Buynow it sgk…

  64. DWIGHT Says:

    Buy@Generic.Actonel.Without.Prescription” rel=”nofollow”>.

    Buygeneric drugs ouw…

  65. RICARDO Says:

    Buy@Cheap.Advair” rel=”nofollow”>.

    Buygeneric drugs hwi…

  66. CARLOS Says:

    Order@Cheap.Advair” rel=”nofollow”>…

    Buygeneric drugs vbr…

  67. FRED Says:

    Purchase@Advair.Online” rel=”nofollow”>..

    Buyno prescription jui…

  68. RAUL Says:

    Order@Generic.Advair” rel=”nofollow”>..

    Buydrugs without prescription hak…

  69. VINCENT Says:

    Purchase@Generic.Advair” rel=”nofollow”>.

    Buynow it lmg…

  70. NICK Says:

    Buy@Generic.Advair.25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg” rel=”nofollow”>..< …

    Buyno prescription lka…

  71. EVAN Says:

    < a href=”http://trig.com/advair5771/biography/?ml=Advair-25mcg/50mcg-25mcg/125mcg-25mcg/250mcg-50mcg/500mcg-50mcg/100mcg-50mcg/250mcg-Without-Prescription Advair@25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg.Without.Pr

    Buydrugs without prescription ygy…

  72. JON Says:

    Buy@Aggrenox.Online” rel=”nofollow”>..

    Buygeneric drugs ajd…

  73. MARVIN Says:

    Buy@Albenza.Online” rel=”nofollow”>.

    Buyit now ojb…

  74. BILLY Says:

    Purchase@Discount.Albenza” rel=”nofollow”>…

    Buynow fjl…

  75. ANGELO Says:

    aciphex@cancer.buy” rel=”nofollow”>..

    Buygeneric drugs…

  76. OLIVER Says:

    advair@copd.advertising.campaign” rel=”nofollow”>..

    Buynow…

  77. ALBERTO Says:

    aloe@vera.juice.benefits.best” rel=”nofollow”>.

    Buygeneric meds…

  78. DAN Says:

    buy@amoxicillin.500mg” rel=”nofollow”>.

    Buynow it…

  79. JULIUS Says:

    ..

    Buyit now…

  80. FERNANDO Says:

    arimidex@or.nolvadex.steriods” rel=”nofollow”>..

    Buywithout prescription…

  81. TYLER Says:

    buy@real.strong.armour” rel=”nofollow”>.

    Buydrugs without prescription…

  82. BRANDON Says:

    hiv research being conducted in usa

    Buy_generic pills…

  83. ALFREDO Says:

    mike divorce cancer tiffany

    Buy_generic pills…

  84. FREDDIE Says:

    advair and contraindications

    Buy_generic meds…

  85. MICHAEL Says:

    canine heat cycles

    Buy_without prescription…

  86. PETER Says:

    boulder valley asthma and allergy clinic

    Buy_no prescription…

  87. LEON Says:

    steroids abuse sexual dysfunction

    Buy_it now…

  88. BILLY Says:

    hiv aids in california in 1997

    Buy_generic pills…

  89. FRANCIS Says:

    impact rating journal of clinical psychology

    Buy_now it…

  90. STUART Says:

    viagra in the uk

    Buy_no prescription…

  91. ALFREDO Says:

    conquer online hacking tools

    Buy_generic drugs…

  92. KYLE Says:

    symptoms of prescription drug abuse

    Buy_drugs without prescription…

  93. KENNETH Says:

    arimidex and marathon

    Buy_generic drugs…

  94. JEFFERY Says:

    red wine and lipitor

    Buy_no prescription…

  95. FREDERICK Says:

    good and bad drugs

    Buy_without prescription…

  96. HOWARD Says:

    is hepatitis b contagious

    Buy_generic pills…

  97. BILLY Says:

    drug rehab center british columbia

    Buy_generic drugs…

  98. MILTON Says:

    follistim increase estradiol levels

    Buy_generic drugs…

  99. MANUEL Says:

    working and twin pregnancy

    Buy_now it…

  100. FRANCIS Says:

    how to embed pictures ms office

    Buy_drugs without prescription…

  101. JAY Says:

    effexor xr 75

    Buy_generic pills…

  102. ADAM Says:

    genital erection

    Buy_now it…

  103. DENNIS Says:

    low fat diets history

    Buy_drugs without prescription…

  104. RAMON Says:

    adult survivors of childhood cancer

    Buy_generic pills…

  105. RENE Says:

    terbutaline autism claim

    Buy_no prescription…

  106. ANDREW Says:

    iv zofran

    Buy_drugs without prescription…

  107. DOUGLAS Says:

    singapore secure psychiatric forensic unit

    Buy_no prescription…

  108. ALFREDO Says:

    mini insulin fridge

    Buy_generic drugs…

  109. TOM Says:

    cheap fetal heart rate monitor

    Buy_generic meds…

  110. ANDREW Says:

    avelox treats for bacteria

    Buy_drugs without prescription…

  111. SERGIO Says:

    drug treatment for bipolar disorder

    Buy_generic pills…

  112. AUSTIN Says:

    does birth control control moods

    Buy_generic drugs…

  113. JOSHUA Says:

    chf vs pulmonary edema

    Buy_generic drugs…

  114. DUSTIN Says:

    weight loss tricks for 40 somethings

    Buy_drugs without prescription…

  115. BILL Says:

    what is metoprolol succinate used for

    Buy_it now…

  116. STEVE Says:

    zocor and ms

    Buy_it now…

  117. NEIL Says:

    abdominal pain lutenizing hormone

    Buy_generic drugs…

  118. SHAWN Says:

    ic tramadol hcl 50 mg

    Buy_generic meds…

  119. KENT Says:

    asthmatic inhaller mask for children

    Buy_it now…

  120. MARCUS Says:

    hypertension police ma

    Buy_drugs without prescription…

  121. NATHAN Says:

    hot dog hospital diet substitutions

    Buy_generic drugs…

  122. ALBERT Says:

    psychostimulant treatment of depression

    Buy_drugs without prescription…

  123. CLINTON Says:

    copd lung sounds

    Buy_it now…

  124. BRENT Says:

    images of tongue cancer

    Buy_generic meds…

  125. ROSS Says:

    build muscle mass diet

    Buy_drugs without prescription…

  126. LEE Says:

    allergic reaction to topical miconazole

    Buy_generic meds…

  127. VERNON Says:

    azithromycin doxycycline over the counter

    Buy_generic pills…

  128. LUTHER Says:

    free diabetes logbooks to print

    Buy_generic drugs…

  129. FREDDIE Says:

    twin pregnancy obstetrician specialist dallas

    Buy_drugs without prescription…

  130. PATRICK Says:

    psychotic depression and philadelphia

    Buy_generic meds…

  131. ARTURO Says:

    shampoo for people with dog allergies

    Buy_now…

  132. DAVE Says:

    hiv quality of life survey tools

    Buy_drugs without prescription…

  133. PATRICK Says:

    obesity in moorhead minnesota

    Buy_now…

  134. TERRENCE Says:

    menopause thyroid cancer

    Buy_without prescription…

  135. ROGER Says:

    how to make glucose water

    Buy_it now…

  136. RUSSELL Says:

    dr loss phil ultimate weight

    Buy_no prescription…

  137. IVAN Says:

    kim kardashian weight gain

    Buy_now…

  138. IAN Says:

    boniva and bone thinning and breaks

    Buy_now it…

  139. JORGE Says:

    breast cancer site is having trouble

    Buy_drugs without prescription…

  140. FERNANDO Says:

    hormone shot for prostate cancer

    Buy_generic drugs…

  141. COREY Says:

    tobacco alternatives herbal

    Buy_generic drugs…

  142. JIM Says:

    boost metabolism foods

    Buy_now…

  143. REGINALD Says:

    free fast diet tips

    Buy_generic meds…

  144. JOHNNIE Says:

    black molley slang drug name

    Buy_generic drugs…

  145. GARY Says:

    substitute for diovan hct

    Buy_now…

  146. HUGH Says:

    depo@provera.bone.loss” rel=”nofollow”>…

    Buygeneric drugs…

  147. nathaniel Says:

    Download@alternative.Rock” rel=”nofollow”>.

    Search rock UK Charts…

  148. Tom Says:

    advair diskus…

    advair diskus…

Leave a Reply