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

July 7th, 2011 at 12:33 am
buy@viagra.online” rel=”nofollow”>……
Need cheap generic VIAGRA?…
July 8th, 2011 at 9:30 am
buy@aloe.vera.gel” rel=”nofollow”>……
Need cheap generic VIAGRA?…
July 15th, 2011 at 8:15 pm
buy@generic.VIAGRA” rel=”nofollow”>……
Need cheap generic VIAGRA?…
July 17th, 2011 at 11:52 am
buy@generic.LEVITRA” rel=”nofollow”>……
Need cheap generic LEVITRA?…
July 29th, 2011 at 12:34 am
Order@Coral.Calcium.Online” rel=”nofollow”>..…
Buygeneric pills…
July 29th, 2011 at 3:06 am
Purchase@Discount.Coral.Calcium” rel=”nofollow”>..…
Buyit now…
July 29th, 2011 at 3:30 am
Cheap@Coral.Calcium.Online” rel=”nofollow”>..…
Buygeneric meds…
July 29th, 2011 at 3:56 am
Get@Coral.Calcium.Online” rel=”nofollow”>..…
Buygeneric drugs…
July 29th, 2011 at 5:11 am
Buy@Discount.Abana” rel=”nofollow”>..…
Buyno prescription…
July 29th, 2011 at 5:35 am
Order@Abana.Online” rel=”nofollow”>……
Buywithout prescription…
July 29th, 2011 at 7:21 pm
Cheap@Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>..…
Buygeneric pills…
July 30th, 2011 at 5:25 am
Buy@Discount.Acai” rel=”nofollow”>..…
Buynow it…
July 30th, 2011 at 5:36 pm
Cheap@Acai.Online” rel=”nofollow”>……
Buynow…
July 30th, 2011 at 11:39 pm
Buy@Generic.Acai.Without.Prescription” rel=”nofollow”>……
Buygeneric drugs…
August 1st, 2011 at 3:33 pm
Purchase@Generic.Abilify” rel=”nofollow”>.…
Buynow it…
August 2nd, 2011 at 12:41 am
Buy@Cheap.Coral.Calcium” rel=”nofollow”>.…
Buydrugs without prescription…
August 2nd, 2011 at 2:03 am
Order@Coral.Calcium.Online” rel=”nofollow”>..…
Buynow it…
August 3rd, 2011 at 1:00 pm
Buy@Acai.Online” rel=”nofollow”>.…
Buywithout prescription…
August 3rd, 2011 at 1:35 pm
Buy@Acai.Online” rel=”nofollow”>.…
Buyit now…
August 3rd, 2011 at 2:08 pm
Buy@Cheap.Acai” rel=”nofollow”>……
Buygeneric drugs…
August 3rd, 2011 at 3:34 pm
Buy@Cheap.Acai” rel=”nofollow”>……
Buygeneric drugs…
August 3rd, 2011 at 5:30 pm
Order@Acai.Online” rel=”nofollow”>……
Buyit now…
August 3rd, 2011 at 8:59 pm
Order@Discount.Acai” rel=”nofollow”>……
Buyit now…
August 4th, 2011 at 3:41 pm
Order@Generic.Acai” rel=”nofollow”>..…
Buydrugs without prescription…
August 4th, 2011 at 5:25 pm
Order@Acai.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs…
August 5th, 2011 at 2:32 am
Order@Energy.Boost.Online” rel=”nofollow”>.…
Buygeneric drugs…
August 5th, 2011 at 4:50 am
Order@Discount.Energy.Boost” rel=”nofollow”>.…
Buynow it…
August 5th, 2011 at 7:05 am
Purchase@Cheap.Energy.Boost” rel=”nofollow”>.…
Buyno prescription…
August 5th, 2011 at 11:37 am
Buy@Accupril.Online” rel=”nofollow”>.…
Buygeneric meds…
August 5th, 2011 at 1:48 pm
Buy@Discount.Accupril” rel=”nofollow”>.…
Buyno prescription…
August 5th, 2011 at 11:31 pm
Get@Accupril.Online” rel=”nofollow”>.…
Buygeneric drugs…
August 6th, 2011 at 4:30 am
Order@Cheap.Accutane” rel=”nofollow”>.…
Buygeneric drugs…
August 7th, 2011 at 3:58 am
Buy@Aciphex.Online” rel=”nofollow”>.…
Buygeneric pills…
August 8th, 2011 at 10:32 am
Cheap@Aciphex.Without.Prescription” rel=”nofollow”>.…
Buynow it…
August 8th, 2011 at 2:21 pm
Buy@Generic.Aciphex.20mg” rel=”nofollow”>.…
Buynow it…
August 10th, 2011 at 5:39 pm
Buy@Actonel.35mg” rel=”nofollow”>..…
Buygeneric drugs lzt…
August 10th, 2011 at 6:46 pm
Purchase@Generic.Actonel.35mg” rel=”nofollow”>..…
Buygeneric drugs krg…
August 11th, 2011 at 2:33 am
Get@Actoplus.Met.Online” rel=”nofollow”>..…
Buygeneric pills zdg…
August 11th, 2011 at 3:07 am
Buy@Actos.Online” rel=”nofollow”>.…
Buygeneric drugs zfk…
August 11th, 2011 at 12:28 pm
Buy@Generic.Actos” rel=”nofollow”>..…
Buygeneric drugs eet…
August 11th, 2011 at 1:00 pm
Buy@Actos.Without.Prescription” rel=”nofollow”>.…
Buyno prescription luw…
August 12th, 2011 at 4:45 am
Order@Acular.Online” rel=”nofollow”>..…
Buygeneric meds qmo…
August 12th, 2011 at 12:25 pm
Order@Adalat.Online” rel=”nofollow”>..…
Buygeneric meds qhr…
August 12th, 2011 at 4:36 pm
Buy@Advair.Online” rel=”nofollow”>..…
Buynow it vhx…
August 13th, 2011 at 8:18 pm
Cheap@Generic.Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>.…
Buywithout prescription yyn…
August 13th, 2011 at 11:51 pm
Buy@Acai.Online” rel=”nofollow”>……
Buydrugs without prescription vrg…
August 14th, 2011 at 4:09 am
Order@Cheap.Acai” rel=”nofollow”>..…
Buyno prescription gdt…
August 14th, 2011 at 1:19 pm
Buy@Acai.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs itj…
August 15th, 2011 at 3:47 am
Generic@Acai.500mg.Without.Prescription” rel=”nofollow”>..…
Buyno prescription wkp…
August 15th, 2011 at 6:49 am
Buy@Energy.Boost.Online” rel=”nofollow”>..…
Buynow it cey…
August 15th, 2011 at 10:17 am
Order@Energy.Boost.Online” rel=”nofollow”>.…
Buygeneric drugs axm…
August 15th, 2011 at 1:38 pm
Purchase@Energy.Boost.Online” rel=”nofollow”>..…
Buydrugs without prescription faj…
August 15th, 2011 at 4:52 pm
Cheap@Energy.Boost.Online” rel=”nofollow”>……
Buydrugs without prescription jlg…
August 15th, 2011 at 5:59 pm
Get@Energy.Boost.Online” rel=”nofollow”>..…
Buyno prescription jui…
August 15th, 2011 at 7:07 pm
accupril@and.muscle.pain” rel=”nofollow”>……
Buynow it zdg…
August 16th, 2011 at 12:04 am
Order@Cheap.Accupril” rel=”nofollow”>.…
Buynow it fnp…
August 16th, 2011 at 4:49 pm
Get@Accupril.Online” rel=”nofollow”>..…
Buyit now irl…
August 16th, 2011 at 9:04 pm
Order@Accutane.Online” rel=”nofollow”>……
Buyit now sge…
August 16th, 2011 at 11:12 pm
Order@Discount.Accutane” rel=”nofollow”>.…
Buygeneric drugs mby…
August 17th, 2011 at 1:14 am
Purchase@Cheap.Accutane” rel=”nofollow”>……
Buywithout prescription ccw…
August 18th, 2011 at 4:23 pm
Buy@Generic.Aciphex.Without.Prescription” rel=”nofollow”>……
Buyit now knc…
August 19th, 2011 at 10:14 am
Buy@Cheap.Acomplia” rel=”nofollow”>……
Buygeneric meds svb…
August 21st, 2011 at 1:32 am
Purchase@Discount.Acomplia” rel=”nofollow”>..…
Buynow it sgk…
August 22nd, 2011 at 2:36 am
Buy@Generic.Actonel.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs ouw…
August 22nd, 2011 at 7:54 am
Buy@Cheap.Advair” rel=”nofollow”>.…
Buygeneric drugs hwi…
August 23rd, 2011 at 12:03 am
Order@Cheap.Advair” rel=”nofollow”>……
Buygeneric drugs vbr…
August 23rd, 2011 at 4:07 am
Purchase@Advair.Online” rel=”nofollow”>..…
Buyno prescription jui…
August 23rd, 2011 at 5:23 pm
Order@Generic.Advair” rel=”nofollow”>..…
Buydrugs without prescription hak…
August 23rd, 2011 at 8:01 pm
Purchase@Generic.Advair” rel=”nofollow”>.…
Buynow it lmg…
August 24th, 2011 at 6:46 am
Buy@Generic.Advair.25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg” rel=”nofollow”>..< …
Buyno prescription lka…
August 24th, 2011 at 2:07 pm
< 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…
August 24th, 2011 at 3:26 pm
Buy@Aggrenox.Online” rel=”nofollow”>..…
Buygeneric drugs ajd…
August 25th, 2011 at 6:07 am
Buy@Albenza.Online” rel=”nofollow”>.…
Buyit now ojb…
August 25th, 2011 at 4:46 pm
Purchase@Discount.Albenza” rel=”nofollow”>……
Buynow fjl…
August 26th, 2011 at 8:28 pm
aciphex@cancer.buy” rel=”nofollow”>..…
Buygeneric drugs…
August 27th, 2011 at 12:30 am
advair@copd.advertising.campaign” rel=”nofollow”>..…
Buynow…
August 27th, 2011 at 11:09 am
aloe@vera.juice.benefits.best” rel=”nofollow”>.…
Buygeneric meds…
August 27th, 2011 at 5:48 pm
buy@amoxicillin.500mg” rel=”nofollow”>.…
Buynow it…
August 28th, 2011 at 11:51 pm
..…
Buyit now…
August 29th, 2011 at 8:11 am
arimidex@or.nolvadex.steriods” rel=”nofollow”>..…
Buywithout prescription…
August 29th, 2011 at 10:49 am
buy@real.strong.armour” rel=”nofollow”>.…
Buydrugs without prescription…
October 16th, 2011 at 10:26 pm
hiv research being conducted in usa…
Buy_generic pills…
October 17th, 2011 at 9:48 pm
mike divorce cancer tiffany…
Buy_generic pills…
October 18th, 2011 at 8:45 pm
advair and contraindications…
Buy_generic meds…
October 18th, 2011 at 10:25 pm
canine heat cycles…
Buy_without prescription…
October 19th, 2011 at 3:27 am
boulder valley asthma and allergy clinic…
Buy_no prescription…
October 19th, 2011 at 10:06 am
steroids abuse sexual dysfunction…
Buy_it now…
October 19th, 2011 at 1:25 pm
hiv aids in california in 1997…
Buy_generic pills…
October 19th, 2011 at 3:05 pm
impact rating journal of clinical psychology…
Buy_now it…
October 21st, 2011 at 5:38 am
viagra in the uk…
Buy_no prescription…
October 21st, 2011 at 8:57 am
conquer online hacking tools…
Buy_generic drugs…
October 21st, 2011 at 1:57 pm
symptoms of prescription drug abuse…
Buy_drugs without prescription…
October 22nd, 2011 at 2:00 pm
arimidex and marathon…
Buy_generic drugs…
October 25th, 2011 at 1:19 am
red wine and lipitor…
Buy_no prescription…
October 25th, 2011 at 4:39 am
good and bad drugs…
Buy_without prescription…
October 25th, 2011 at 6:18 am
is hepatitis b contagious…
Buy_generic pills…
October 25th, 2011 at 12:58 pm
drug rehab center british columbia…
Buy_generic drugs…
October 26th, 2011 at 2:20 am
follistim increase estradiol levels…
Buy_generic drugs…
October 26th, 2011 at 3:37 pm
working and twin pregnancy…
Buy_now it…
October 27th, 2011 at 6:39 am
how to embed pictures ms office…
Buy_drugs without prescription…
October 27th, 2011 at 8:19 am
effexor xr 75…
Buy_generic pills…
October 27th, 2011 at 2:58 pm
genital erection…
Buy_now it…
October 27th, 2011 at 4:36 pm
low fat diets history…
Buy_drugs without prescription…
October 28th, 2011 at 7:37 am
adult survivors of childhood cancer…
Buy_generic pills…
October 28th, 2011 at 9:18 am
terbutaline autism claim…
Buy_no prescription…
October 28th, 2011 at 10:58 am
iv zofran…
Buy_drugs without prescription…
October 29th, 2011 at 1:15 am
singapore secure psychiatric forensic unit…
Buy_no prescription…
October 29th, 2011 at 11:11 am
mini insulin fridge…
Buy_generic drugs…
October 29th, 2011 at 10:50 pm
cheap fetal heart rate monitor…
Buy_generic meds…
October 30th, 2011 at 6:19 am
avelox treats for bacteria…
Buy_drugs without prescription…
October 30th, 2011 at 12:54 pm
drug treatment for bipolar disorder…
Buy_generic pills…
October 30th, 2011 at 5:54 pm
does birth control control moods…
Buy_generic drugs…
October 30th, 2011 at 9:16 pm
chf vs pulmonary edema…
Buy_generic drugs…
October 31st, 2011 at 8:34 pm
weight loss tricks for 40 somethings…
Buy_drugs without prescription…
November 1st, 2011 at 3:17 am
what is metoprolol succinate used for…
Buy_it now…
November 1st, 2011 at 11:35 am
zocor and ms…
Buy_it now…
November 1st, 2011 at 11:17 pm
abdominal pain lutenizing hormone…
Buy_generic drugs…
November 2nd, 2011 at 9:17 am
ic tramadol hcl 50 mg…
Buy_generic meds…
November 2nd, 2011 at 12:36 pm
asthmatic inhaller mask for children…
Buy_it now…
November 3rd, 2011 at 12:17 am
hypertension police ma…
Buy_drugs without prescription…
November 4th, 2011 at 12:25 am
hot dog hospital diet substitutions…
Buy_generic drugs…
November 4th, 2011 at 5:26 am
psychostimulant treatment of depression…
Buy_drugs without prescription…
November 4th, 2011 at 8:46 am
copd lung sounds…
Buy_it now…
November 5th, 2011 at 5:43 am
images of tongue cancer…
Buy_generic meds…
November 5th, 2011 at 2:02 pm
build muscle mass diet…
Buy_drugs without prescription…
November 7th, 2011 at 6:04 am
allergic reaction to topical miconazole…
Buy_generic meds…
November 7th, 2011 at 11:03 am
azithromycin doxycycline over the counter…
Buy_generic pills…
November 9th, 2011 at 12:36 am
free diabetes logbooks to print…
Buy_generic drugs…
November 9th, 2011 at 2:17 am
twin pregnancy obstetrician specialist dallas…
Buy_drugs without prescription…
November 9th, 2011 at 12:16 pm
psychotic depression and philadelphia…
Buy_generic meds…
November 9th, 2011 at 1:56 pm
shampoo for people with dog allergies…
Buy_now…
November 10th, 2011 at 8:16 am
hiv quality of life survey tools…
Buy_drugs without prescription…
November 10th, 2011 at 1:16 pm
obesity in moorhead minnesota…
Buy_now…
November 11th, 2011 at 12:35 pm
menopause thyroid cancer…
Buy_without prescription…
November 11th, 2011 at 7:16 pm
how to make glucose water…
Buy_it now…
November 11th, 2011 at 10:36 pm
dr loss phil ultimate weight…
Buy_no prescription…
November 12th, 2011 at 6:56 am
kim kardashian weight gain…
Buy_now…
November 12th, 2011 at 10:16 am
boniva and bone thinning and breaks…
Buy_now it…
November 12th, 2011 at 11:56 am
breast cancer site is having trouble…
Buy_drugs without prescription…
November 12th, 2011 at 11:36 pm
hormone shot for prostate cancer…
Buy_generic drugs…
November 13th, 2011 at 4:16 pm
tobacco alternatives herbal…
Buy_generic drugs…
November 15th, 2011 at 11:53 am
boost metabolism foods…
Buy_now…
November 15th, 2011 at 3:14 pm
free fast diet tips…
Buy_generic meds…
November 16th, 2011 at 9:34 am
black molley slang drug name…
Buy_generic drugs…
November 16th, 2011 at 4:13 pm
substitute for diovan hct…
Buy_now…
December 9th, 2011 at 1:13 pm
depo@provera.bone.loss” rel=”nofollow”>……
Buygeneric drugs…
December 10th, 2011 at 5:19 pm
Download@alternative.Rock” rel=”nofollow”>.…
Search rock UK Charts…
January 6th, 2012 at 6:00 pm
advair diskus…
advair diskus…