Posted by Steve on 08/29/07 22:04
"Steve" <no.one@example.com> wrote in message
news:V_lBi.82$tb5.58@newsfe12.lga...
|
| "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);"
| >
of course you'd want to add in:
style="background-image:url(<?= $img_dir ?>/images/<?= $tab ?>);"
so that the default image is displayed in the div when the page loads.
[Back to original message]
|