newb Posted August 23, 2006 Share Posted August 23, 2006 [code]if (document.images) { img01 = new Image(); img01.src = "images/buttons/0home.gif"; img012 = new Image(); img012.src = "images/buttons/1home.gif"; img02 = new Image(); img02.src = "images/buttons/0forum.gif"; img022 = new Image(); img022.src = "images/buttons/1forum.gif"; img03 = new Image(); img03.src = "images/buttons/0roster.gif"; img032 = new Image(); img032.src = "images/buttons/1roster.gif"; img04 = new Image(); img04.src = "images/buttons/0matches.gif"; img042 = new Image(); img042.src = "images/buttons/1matches.gif"; img05 = new Image(); img05.src = "images/buttons/0gallery.gif"; img052 = new Image(); img052.src = "images/buttons/1gallery.gif"; img06 = new Image(); img06.src = "images/buttons/0downloads.gif"; img062 = new Image(); img062.src = "images/buttons/1downloads.gif"; img07 = new Image(); img07.src = "images/buttons/0media.gif"; img072 = new Image(); img072.src = "images/buttons/1media.gif"; img08 = new Image(); img08.src = "images/buttons/0demos.gif"; img082 = new Image(); img082.src = "images/buttons/1demos.gif"; img09 = new Image(); img09.src = "images/buttons/0sponsors.gif"; img092 = new Image(); img092.src = "images/buttons/1sponsors.gif"; img10 = new Image(); img10.src = "images/buttons/0linkage.gif"; img102 = new Image(); img102.src = "images/buttons/1linkage.gif"; }function OnImage(name) { if (document.images) { fullname = eval(name + "2"); document[name].src = fullname.src; }}function OffImage(name) { if (document.images) { fullname = eval(name); if (fullname.complete) { document[name].src = fullname.src; } }}[/code]how do i convert that to php Link to comment https://forums.phpfreaks.com/topic/18361-convert-javascript-to-php/ Share on other sites More sharing options...
AndyB Posted August 23, 2006 Share Posted August 23, 2006 It looks like a standard mouseOver image switch using javascript. It runs on the client machine. It therefore requires a language that can execute on the client machine. php only executes on a server. javascript executes on a client.What exactly are you trying to do and why? Link to comment https://forums.phpfreaks.com/topic/18361-convert-javascript-to-php/#findComment-78944 Share on other sites More sharing options...
wildteen88 Posted August 23, 2006 Share Posted August 23, 2006 Is that used for a menu on your site and when you mouse over the image it changes to something else. If so a good subsitute is CSS and not PHP. With CSS you use the :hover pesudo selector. Link to comment https://forums.phpfreaks.com/topic/18361-convert-javascript-to-php/#findComment-79103 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.