hi everyone .. i want a javascript were i can change the text dynamically when the page is live from (Arial to Times) something like that..but when i click arial or times the page should nt get refreshed can any one pls help me in dis.. or can anyone pls provide a script for dis..???
views:
51answers:
2
A:
You should do this with javascript, not php. Use javascript to change the style of the text dynamically. Php is run on the server, and is therefor not in the picture for your no-reload scenario.
Example
Here is the first simple example google returned (e.g. search "javascript change text font" for more examples):
<html>
<body>
<div id=hey>
<a onMouseover="document.getElementById('hey').style.fontFamily='courier'"> Make me COURIER!</a> ----
<a onMouseover="document.getElementById('hey').style.fontFamily='verdana'"> Make me VERDANA!!!</a>
</div>
</body>
</html>
catchmeifyoutry
2010-01-16 09:06:27
A:
If you really want to use PHP and don't want the entire page to reload, you would need some form of AJAX implmentation.
However...your problem can be solved more easily with Javascript and I would recommend using that instead. The jQuery library allows you to change CSS styles with minimal code. There are a few code examples on changing style attributes on the jQuery website.
JustChris
2010-01-16 09:07:40
http://docs.jquery.com/CSS/css#namevalueIt should get you started on applying similar code to change the font type of a paragraph. Download Jquery for your site and you'll be ready to go.
JustChris
2010-01-16 09:13:37