| | |
Random CSS
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2006
Posts: 10
Reputation:
Solved Threads: 0
Hello there, I need my page to randomly select a CSS document. I don't want the user to select it, but instead to do it when the page loads.
This is the script I have so far:
This function does write the proper <style> tag, but it does not work. :evil: When I go to "view source", I don't see the line that suppously was written by the JS function.
PLEASE HELP!!:-|
This is the script I have so far:
<script language="javascript" type="text/javascript">
var ranNum= Math.floor(Math.random()*3+1);
document.write("<link rel='stylesheet' href='hd"+ranNum+".css' type='text/css'>");
</script>This function does write the proper <style> tag, but it does not work. :evil: When I go to "view source", I don't see the line that suppously was written by the JS function.
PLEASE HELP!!:-|
•
•
Join Date: Feb 2006
Posts: 50
Reputation:
Solved Threads: 1
•
•
•
•
When I go to "view source", I don't see the line that suppously was written by the JS function.
Site admin at NetBulge.com, a place set out to improve the web 1 good article at a time :)
•
•
Join Date: Apr 2006
Posts: 21
Reputation:
Solved Threads: 0
•
•
•
•
I need my page to randomly select a CSS document. I don't want the user to select it, but instead to do it when the page loads.
█ WeLoveCSS.com • XHTML/CSS Forum for beginners to advanced users
Can't find any good CSS Forums? WLC is the right place for you!
Can't find any good CSS Forums? WLC is the right place for you!
•
•
Join Date: Apr 2006
Posts: 10
Reputation:
Solved Threads: 0
Me again, sorry for the late response, it was the weekend.
I don't want the user to select the a CSS and then refresh the page. I want to do that for them.
The way I have setup my page is that I have one CSS for the whole page: styles.CSS, and then I have 3 other CSS documents (hd1.css, hd2.css, hd3.css) that I want to use them in the document randomly.
Here is the page
http://www.arch.usyd.edu.au/~jrui0688/template.htm
(this is the testing page).
I don't want the user to select the a CSS and then refresh the page. I want to do that for them.
The way I have setup my page is that I have one CSS for the whole page: styles.CSS, and then I have 3 other CSS documents (hd1.css, hd2.css, hd3.css) that I want to use them in the document randomly.
Here is the page
http://www.arch.usyd.edu.au/~jrui0688/template.htm
(this is the testing page).
![]() |
Similar Threads
- Random CSS Stylesheet selector exists? (JavaScript / DHTML / AJAX)
- A CSS Question - Stoping Fonts from Becoming Giants! (HTML and CSS)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Text Not Showing up in IE, Fine in Firefox * NS
- Next Thread: how do i change fore color in a textbox with javascript
Views: 3818 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxexample ajaxjspservlets array automatically autoplay beta blackjack boarder box button captcha card cart codes column css date debugger decimal design developer dom download element embed enter error events firefox flash focus form frameworks gears getselection google gwt hiddenvalue hint html htmlform ie7 iframe index java javascript javascripthelp2020 javascripts jquery jsp libcurl listbox maps marquee masterpage media menu microsoft mimic mp4 offline onerror onmouseover parameters paypal php player position post problem programming prototype rating redirect safari scale scriptlets search security select size software sources starrating toggle tweet twitter unicode validation variables w3c web webkit webservice website window windowofwords xml






