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]
|