You are here: Re: Is this possible? « PHP Programming Language « IT news, forums, messages
Re: Is this possible?

Posted by Steve on 08/29/07 21:59

"Leoa" <leondria.barbee@gmail.com> wrote in message
news:1188422263.801132.124720@r34g2000hsd.googlegroups.com...
| Can you use javascript to activate a php function like so:
| <?php
| $tab="Tab.gif";
| function myfunction($txt)
| {
| $tab = $txt;
| echo($tab);
| }
|
| ?>
| <div class="backg" onMouseOver="<? php myfunction("Tab3.gif"); ?>"
| STYLE="background-image: url(<?=$img_dir?>/images/<?php echo($tab);?
| > )"
|
| I'm trying to dynamically change the tab button when the when the user
| mouse over the tab.

php executes on the server. javascript (etc.) executes in the browser on the
client's pc. this is strickly a javascript endeavor. however, here's how i'd
think about it...


<div mOverSrc="<?= $img_dir ?>/images/Tab3.gif"
mResetSrc="<?= $img_dir ?>/images/<?= $tab ?>"
onmouseover="this.style.backgroundImage = url(this.mOverSrc);"
onmouseout="this.style.backgroundImage = url(this.mResetSrc);"
>

something like that allows you to set the images in php yet toggle them on
the client using javascript. i haven't checked the above, so there may be
syntax type problems. it's more or less, just to help you think about it in
another way.

cheers.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация