Basically, I'm trying to have a navigation bar on my website with the days of the week on it. I have 7 images of the bar, each starting with a diff day (so one is monday-sunday, the next is tuesday-monday, etc) and I've so far managed to make it display the correct image depending on the day with this code:
var a= new Date(); var b= a.getDay(); switch(b) { case 0: document.write("<img src="sunday.jpg">") break case 1: document.write("<img src="monday.jpg">") break etc
My problem is that I need the days to be links, so I tried creating an image map:
Which really didn't work either. Which brings me to my question: Is it possible at all to do what I'm trying? And have I made a total mess of the code?
I have a menu on a new website im developing. The menu is going to be within a PHP include file. I need a way of (using JS) the current page having its menu item with a different image to the others e.g. a "selected" image.The code im experimenting with, and which may shed a bit more light on what im trying to achieve is as follows:
var url = window.location.pathname; var filename = url.substring(url.lastIndexOf('/')+1); if (filename = 'about.php')
I've just started learning jquery and have been trying to use this code which I found on this forum.I want to detect some text (addClients) in the url and add an css id to a list item with the class m1 (li class="m1") - so I get (li class="m1" id="expanded"):
This is what I have so far (which is not working)$(function() { $(document).ready(function() { var url = location.pathname;
I'm looking at integrating a JavaScript/PHP/MySQL dependant drop-down menu order configurator. My client sells a lot of high-tech stuff, which needs to be customized, so I was thinking that this would be the perfect solution.
Rather than have the list statically populated with HTML tables, if the clients could automatically configure them to their specifications, then this would be the best option to avoid confusion, as well as save my client's support desk time and money during the pre-sales process.
However, I am not having luck finding what I need when Googling for dynamic dependant javascript php menus... a lot of basic JavaScript menus comes up, and that's great, and I really don't have the time to spend on this project creating a custom mysql/php implementation.
I am using jquery.validate.js. I am having 2 input fields. The condition is the second input value should not be less than first input value. The second condition is the first input value should not be greater than 2nd value. I tried with different options but it didnt work. Is there any jquery function for this validation? Or pl
Ive written some code to try and resize a page dependant on the content oof an iframe. Code is as follows:
window.onload=sizeAdj(); function sizeAdj() { var elFrame = document.getElementById('theFrame'); var elTable = document.getElementById('tableGrab'); var elDivMain = document.getElementById('main'); var elDivWrapper = document.getElementById('wrapper'); [Code]....
I originally thought that I would just be able to resize the iframe and the other elements would follow suit but as you can see Ive tried to resize the other encasing elements also. The code resizes partially in chrome but only to a certain point and not to the full height of the doc content.
I've been using this bit of code to limit the number of characters in a text field (taken from http://www.shiningstar.net/articles/articles/javascript/dynamictextareacounter.asp:
<SCRIPT LANGUAGE="JavaScript"> function textCounter(field,cntfield,maxlimit) { if (field.value.length > maxlimit) // if too long...trim it!
I have a form setup on my webpage that grabs a couple pieces of information from the user (ie name, address, etc.) and when the user enters this information and submits the form, the base URL of Code:
On my site I use an SVG image. The <embed> tag works fine in Opera and Firefox. And <img> works fine in Chrome and Safari. I would like to know if it is possible to change the tag with an 'if' browser statement, and if it is ho would I write it.
if (jQuery.browser.webkit) { * // Replace <embed> with <img> }
I have a wordpress website with which I wish to provide content via an iframe on facebook.. Without using a wordpress plugin, I would like to know if I provide a function in jquery that basically says if viewport is equal to 520px then either load this css file or add this body class.. Also, if viewport is = to 520px then hide this element.. I think this can be done but after a lot of searching, I cannot seem to find a definative answer..
For a lot of years now I've used a javascript that does a simple rollover image swap, but also changes another alternate image at the same time. It's always worked like a charm.Lately I realized that the script no longer works in IE, though it used to in older versions of IE (I think it stopped working in anything past IE 7). It still works fine in Firefox, Safari, etc.I haven't been able to find a good alternative for this script, so I'm really trying to get it to work again in IE, but so far no luck.
Here's the link to the actual script itself. http:[ur;l]....
I found a bug in IE6, though it is known already. If I have a CSS background property set to some image, such as background:url(myimg.gif);, and I apply this property to some html element, say DIV, and refresh DIV every 10 seconds, background image is reguested every 10 seconds for IE6, too.
The fix which I found did not fix the problem: try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {} Code:
I don't know if this is possible, so I figured I'd ask a few gurus. I know it is possible to have an image change at a certain time of day, and it's also possible to have an image change by day, but is there a script to do both?
What I want to do is have the first image show from 8am cst to 6pm cst mon-fri, it's our open sign for live chat. The the rest of the time have the second image.
Anyone know how to pop-up image for visitor that visiting for first time?
the pop-up image should be appears 30seconds then it will open new window tab with adress page that i have attached to image then after 30seconds the pop-up automatically close.
I have 10 image libraries and I want to see 2 pic at a time from each image library. I want to make a scroll option where I can see 1image from each library. Any advise on scrolling panel using jquery.
do the following: I have a thumbnail image that on rollover swaps to another image. At the same time i want to do a fade out/fade in animation between the images. Most of it is working but when the page loads for the first time there is no swaping of the image but just a fast opactity effect on the first image. Then if i try the rollover for the second time it does work as expected. Is it because the image that im loading doesn't load fast enough and the whole animation onRollover doesn't happen? I also have a problem when Rollover fast on the thumbnails. It just stays on the second image but doesn't go back to the first original image? For some reason the animation gets confused between the Rollover and Rollout states. Here is a link to see the example
[Code]...
I know this is not a good practice but do is why im looking for help in this forum.
However, I just want to add a small bit of functionality to a new site to make the waiting site owner happy.As you can see here, I got a big image of glasses on the top right of the home page.I do this with CSS only:Html:
I need to build a slider. which is not there in the page when it loads. then after few seconds it appears and slides from the right hand side of the window and stops at some position on the screen. then after few seconds it changes its image into another one. each and every one of the images has a different displaying time. that time is a database data and i have to specify it accordingly... I have no idea how to do this and i am a newbie to javascript. i don't know whether javascript can do this, maybe another technology..
I use DIV tags with onMouseOver action on the DIV-s. I want to download and show a photo if an onMouseOver activates. This is simple and works but there is a problem.First time I move my mouse cursor on the DIV the photo doesn't appear, only its border. When I move the mouse off and back again, the photo appears right. I want to show the photo first time well.There is a solution: preloading images with JavaScript invoked with the onLoad event of the BODY tag. But I would have numerous (100+) photos, so it's a bad idea to preload all the photos (and users usually want to see only a few, not all of them). It is acceptable to wait a second or two after activating onMouseOver while the photo is downloading but it's not acceptable to do TWO onMouseOver actions for a photo