PDA

View Full Version : Javascript code for 3 state button


bill3786
01-09-2012, 10:33 AM
I'm using Vista Buttons to generate 3 state buttons. This creates the three gif images and some javascript code.

This is typical code

vb2jwvan=xppr('2jwva_0.gif');vb2jwvao=xppr('2jwva_ 1.gif');vb2jwvac=xppr('2jwva_2.gif');var btIdPref='vb';function xppr(im){var i=new Image();i.src='buttontrial2-files/bt'+im;return i;};function xpe(id){x=id.substring(0,id.length-1);if(document[btIdPref+x])document[btIdPref+x].src=eval(btIdPref+id+'.src');return false;};

What is the correct way to add such a button to a site and where is the javascript code placed in relation to the images.