Is this possible?
am 29.08.2007 23:17:43 von LeoaCan you use javascript to activate a php function like so:
$tab="Tab.gif";
function myfunction($txt)
{
$tab = $txt;
echo($tab);
}
?>
STYLE="background-image: url(=$img_dir?>/images/ > )"
I'm trying to dynamically change the tab button when the when the user
mouse over the tab.
this site has the nav in a module.
any suggestions please....
Re: Is this possible?
am 29.08.2007 23:39:58 von jakeYes, it's possible, but not in the way that you are thinking. You
should try looking into AJAX.
Leoa wrote:
> Can you use javascript to activate a php function like so:
>
> $tab="Tab.gif";
> function myfunction($txt)
> {
> $tab = $txt;
> echo($tab);
> }
>
> ?>
>
> STYLE="background-image: url(=$img_dir?>/images/ >> )"
>
> I'm trying to dynamically change the tab button when the when the user
> mouse over the tab.
>
> this site has the nav in a module.
>
> any suggestions please....
>
Re: Is this possible?
am 29.08.2007 23:59:45 von Steve"Leoa" "Steve" On Aug 29, 5:04 pm, "Steve" Morlaath@gmail.com wrote: On Wed, 29 Aug 2007 23:59:45 +0200, Steve | I really don't see why people keep pointing out that php is server > "Rik Wasmus"
news:1188422263.801132.124720@r34g2000hsd.googlegroups.com.. .
| Can you use javascript to activate a php function like so:
|
| $tab="Tab.gif";
| function myfunction($txt)
| {
| $tab = $txt;
| echo($tab);
| }
|
| ?>
|
| STYLE="background-image: url(=$img_dir?>/images/
| > )"
|
| 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...
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.
Re: Is this possible?
am 30.08.2007 00:04:41 von Steve
news:V_lBi.82$tb5.58@newsfe12.lga...
|
| "Leoa"
| news:1188422263.801132.124720@r34g2000hsd.googlegroups.com.. .
|| Can you use javascript to activate a php function like so:
||
|| $tab="Tab.gif";
|| function myfunction($txt)
|| {
|| $tab = $txt;
|| echo($tab);
|| }
||
|| ?>
||
|| STYLE="background-image: url(=$img_dir?>/images/
|| > )"
||
|| 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...
|
|
|
| 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.
Re: Is this possible?
am 30.08.2007 05:25:20 von Morlaath
> "Steve"
>
> news:V_lBi.82$tb5.58@newsfe12.lga...
> || "Leoa"
>
> |news:1188422263.801132.124720@r34g2000hsd.googlegroups.com. ..
> || Can you use javascript to activate a php function like so:
> ||
> || $tab="Tab.gif";
> || function myfunction($txt)
> || {
> || $tab = $txt;
> || echo($tab);
> || }
> ||
> || ?>
> ||
> || STYLE="background-image: url(=$img_dir?>/images/
> || > )"
> ||
> || 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...
> |
> |
> |
> | 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.
I really don't see why people keep pointing out that php is server
side and javascript is client-side, is if that makes it impossible to
implement. JSP is server-side as well, and you can embed JSP scriplets
and what not into javascript just fine. Just because code is server
side doesn't mean it has to execute on the first pass (which seems to
be what php does) .... i.e if I wanted to do something like this in
JSP it would work just like you would expect.
Not that I'm saying you should switch to Java webapps especially since
webhosts charge too much to run JBoss, Tomcat, etc and Java Struts or
JSF is much harder to learn and implement. But .....
Re: Is this possible?
am 30.08.2007 05:48:45 von Jerry Stuckle
> On Aug 29, 5:04 pm, "Steve"
>> "Steve"
>>
>> news:V_lBi.82$tb5.58@newsfe12.lga...
>> || "Leoa"
>>
>> |news:1188422263.801132.124720@r34g2000hsd.googlegroups.com. ..
>> || Can you use javascript to activate a php function like so:
>> ||
>> || $tab="Tab.gif";
>> || function myfunction($txt)
>> || {
>> || $tab = $txt;
>> || echo($tab);
>> || }
>> ||
>> || ?>
>> ||
>> || STYLE="background-image: url(=$img_dir?>/images/
>> || > )"
>> ||
>> || 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...
>> |
>> |
>> |
>> | 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.
>
> I really don't see why people keep pointing out that php is server
> side and javascript is client-side, is if that makes it impossible to
> implement. JSP is server-side as well, and you can embed JSP scriplets
> and what not into javascript just fine. Just because code is server
> side doesn't mean it has to execute on the first pass (which seems to
> be what php does) .... i.e if I wanted to do something like this in
> JSP it would work just like you would expect.
>
Because Java Server Pages are Java - and have absolutely NOTHING to do
with JavaScript (except for the letters "J", "a", "v" and "a".
If you knew that, you wouldn't be posting this crap.
>
>
>
>
> Not that I'm saying you should switch to Java webapps especially since
> webhosts charge too much to run JBoss, Tomcat, etc and Java Struts or
> JSF is much harder to learn and implement. But .....
>
But that's exactly what you are saying. Even though you don't know crap.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Is this possible?
am 30.08.2007 09:59:25 von luiheidsgoeroe
> "Leoa"
> news:1188422263.801132.124720@r34g2000hsd.googlegroups.com.. .
> | Can you use javascript to activate a php function like so:
> |
> | $tab=3D"Tab.gif";
> | function myfunction($txt)
> | {
> | $tab =3D $txt;
> | echo($tab);
> | }
> |
> | ?>
> |
>"
> | STYLE=3D"background-image: url(=3D$img_dir?>/images/
b);?
> | > )"
> |
> | I'm trying to dynamically change the tab button when the when the us=
er
> | 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 h=
ow =
> i'd
> think about it...
>
>
>
Short_tags, never a good idea....
-- =
Rik Wasmus
My new ISP's newsserver sucks. Anyone recommend a good one? Paying for =
quality is certainly an option.Re: Is this possible?
am 30.08.2007 10:32:18 von Steve
| side and javascript is client-side, is if that makes it impossible to
| implement.
i'll keep saying it until the op gets it. and it sounds like you don't quite
have it yet either.Re: Is this possible?
am 30.08.2007 10:33:24 von Steve
> | Short_tags, never a good idea....
>
> unless you control your server's settings. ;^)
You claim it is a _good_ idea to use it if you control the server?
-- =
Rik Wasmus
My new ISP's newsserver sucks. Anyone recommend a good one? Paying for =
quality is certainly an option.
Re: Is this possible?
am 30.08.2007 15:08:24 von Steve
news:op.txvcz6k25bnjuv@metallium.lan...
On Thu, 30 Aug 2007 10:33:24 +0200, Steve
>>
> function myfunction($txt)
> {
> $tab = $txt;
> echo($tab);
>
> }
>
> ?>
>
> STYLE="background-image: url(=$img_dir?>/images/
>
> > )"
>
> I'm trying to dynamically change the tab button when the when the user
> mouse over the tab.
>
> this site has the nav in a module.
>
> any suggestions please....
For this look to Javascript. Search in google "javascript image
preload".
http://satya61229.blogspot.com/2007/03/passing-value-javascr ipt-php-javascript.html