I am building a dhtml menu system and it works great in ie 4.0+ and nn6 but in nn4.7 the table background color inside the layers doesn't show up. It does in the other two have a look Code:
I'm working on my last JavaScript project for school and have encountered a few problems. The two issues that I'm having with this script are: - The cookies only work in Internet Explorer; - I can't figure out the code to save the 3rd text input field as a cookie that will automatically change the background color to the user's fav color.
I'm having a problem with one of my Labs and My TA is not answering emails.I need to make a button, that when you click it, turns the bgColor blue, when you click it twice, it turns bgColor yellow, and a third time turns it orange.The tricky part is, I need to use an internal CSS style sheet for the color, and a function for the javascript.Here is what I have so far, but I'm completely stuck.
I need to create an external .JS in perl script, with a Var that holds the bgcolor of a table. I need it to be an external .JS file because i will be changeing the color values alot.
I dont want to generate the HTML, at this time, with perl. Createing the .JS file is easy, what i need to know is:
1. What the .JS file needs to look like. 2. And how to assign the table bgcolor to the var stored in the .JS file. :) The .JS file will need several Vars
var color1 = "#000000"; var color2 = "#000000"; var color3 = "#000000";
I wrote this code bellow but it doesn't work how I get to bgcolor of tr tag? <table id="menutable" name="table1"> <tr onmouseover="ChangeCol()" id="tr_1"><li><a href="main.html" name="main" target="main">Main Page</a><br/></tr> <script language="JavaScript" type="text/javascript">
Is there a way to dynamically (e.g. upon onClick) change the bgColor attribute of a table cell? I tried cell.setAttribute("bgColor", someColor), where someColor was a string of the form "#RRGGBB", but nothing happened.
Also, how can I set the mouse cursor to be an arrow when it hovers over these table cells? (It's an insertion bar now.)
I'm trying to use Javascript to have an array of images that load randomly AND work in a slideshow manner so change every 3 seconds (in a logical order). The code I have below presents a random image but how do I get them to continue from the random image and change to the next every 3 seconds?
I've looked for a solution to this issue, but it seems like a little different scenario than other situations. I made a system for generating friend requests on Facebook. I have a grid that is 6 x 3, for a total of 18 cells. Each cell has a picture in it, and the picture is linked to the Facebook friend request page. My problem is that since each cell is populated at random from the array, I'm getting lots of repeats. For example, some picutures are in 5 cells, and some are in none. I'm trying to figure out how to make it so that once a picture is used once in the grid, it does not get used again in the same grid.I still want every cell filled at random on each page load, I just want to prevent the repeating.
Here's my current code: <script type="text/javascript"> var vip_list=new Array( new Array('http://profile.ak.fbcdn.net/v225/1616/88/s1220771654_2158.jpg','http://www.facebook.com/addfriend.php?id=1220771654'), new Array('http://profile.ak.fbcdn.net/v223/1233/29/s904885342_9055.jpg','http://www.facebook.com/addfriend.php?id=904885342'),
For my website I would like to create a famous last words generator (randomized), and random page generator (within my site). What is the code for random quotes and random links?
I am new to javascript but have been using java for quite a while. I am looking to make a random quote (out of ten possible quotes) appear in my h2 tag in a page i am working on. In java, i would make a random number generator, in javascript it looks like this:
Code: var randomnumber=Math.floor(Math.random()*11) Then make an if statement: Code: if randomnumber=1 { var quote="Live long and prosper" }
document.write(var quote); Could someone more experienced than me tell me if my code looks good and how would a go about getting "var quote" in my h2 tag?
I'm new at Javascript, and have written a script for a series of random roll-over button images, but one thing I would like to add is a function that checks to make sure that there are no duplicates in the randomly generated variables that choose the pictures.
Can anyone give me a hand with this? One other thing I can't seem to figure out is how to manage the "onLoad" aspect of caching my roll-over images (DW has locked the <body onload> function into a template, so I can't mess with it...). so my rollover graphics are grabbed from the server in "real time" during mouse-over, which is a bit "goofy" and "slow" in terms of instant rollover effect. I'm sure that there is a much more efficient way of doing this, but I've been able to learn a lot by tweaking DW's way of doing things, so it's not a total loss.
In an external JS file, I set up a series of 10 random variables using the Math.random and Math.round functions like so:
var btn0 = Math.random()*100; btn0 = Math.round(btn0); var btn1 = Math.random()*100; btn1 = Math.round(btn1); .... etc for 10 buttons
Then in my page, I piggy-back onto Dreamweaver's built-in roll-over handlers, like so (to write the instances of each rollover image);
For this particular page, I'm pretty much stuck with DW's coding because it's locked into a template that governs my site navigation. Thanks for any pointers or help ...
I've found examples of bookmarklets that select a URL from a page at random, but I'd like one that generates part of the URL at random.
If you have a bunch of images that are named: mydomain.com/images/abcd.jpg where abcd is can be any combination of 4 lowercase letters - is there a way of having the bookmarklet generate the letters randomly when clicked?
I'm able to do it using AppleScript & Safari but would like it to work from within Safari - which is missing the "Scripts" menu that most Apple apps have :(
It looks as if bookmarklets are the only option, but I've only ever used javascript to select randomly from existing arrays of images and don't fancy typing in the names of a couple of thousand images...
1.) the background color to change randomly with 5 different colors.(change on page load)
2,) 10 different quotes randomly fadeing in and out in random spots on the webpage. with a delay timer on them, so they keep changing as the page is open. Not random each time the page is loaded.
I remember there is a programming language where you can initialize the random number generator, so that it can - if you want - give you the exactly same sequence of random numbers every time you initialize it with the same parameter. Can this be done with JavaScript? I couldn't find anything in the documentation. Basically, what I want to achieve is to obtain always the same sequence of random numbers for the same given initialization value (but of course different sequences for different init values).
Problem: I have three containers (divs) all with different background images assigned via a class. Each div will contain a background image displaying a different product. I'd like these three divs to randomly assign a class via JavaScript.The problem I'm running into is preventing the same class from being assigned twice to two divs on the same page load. Then you'd have two divs with the same background image.
Now i got a function newgame() and i wanna display random word from this array in rectangles gray styled... Here is the problem. I can make to display random words, but i dont know how i make this words with the css style together - rectangels around a char. But the words are different length so i dunno?
but I want to add that random number to a value that is enterred into an inputbox and get a total. How can I do this using Javascript and put the result into a hidden field. I will also need to use that same random number in another place on another form .
I'm trying to apply something in my forums, where a member could post something let's say:"Hi, I am number 1, 6"And what would happen is that, a number from 1 to 6 would be the content, for example, it would be:"Hi, I am number 3"But if you refresh the page, it would still be the same number. Like it won't be randomized again.So how do I make a javascript/html code that would make a one time number randomizer.
I am using a module called mod_pageear in my joomla based site that displays an image in the page when the trigger is scrolled over. I would like to change the code to access images in a folder on a random basis. The existing section of the code that accesses the single image is as follows: Code: