I'd like to show tree structures using collapsible multi-level nested <ul>
lists (with open/closed "disclosure triangles" as list-style-images).
Something like this:
Clicking on the text following <li> (or on the list-style-image)
collapses/expands the rest of the content of that <li> (not shown here).
The problem is that each click bubbles up to the topmost list item. That is,
a click on "Level 2" first executes the innermost <li> onclick handler, then
the one for the next-outer-level <li> and so on. How can I make it so that
only the handler for the <li> that's clicked is executed? (returning false
from onclick didn't help in IE 6)
(I know I could wrap the text in <span>s and add the onclick handlers to
those instead, but that's a bit ugly, and the list-style-image would be out
of action).
I'm using an image as my submit button. I want it to check to ensure all boxes have a value before submitting (I will make the verification more stringent later), and if there is none, to cancel the form submission. I created a readonly input box that changes from white to a visible color to use as a status indicator for now.It displays the correct status in either scenario, but return false doesn't seem to be stopping the page from loading. What function would do that?
My question is, what do I need to do to stop a browser from jumping to the top of the page when a user clicks on a link which has a jquery function attached to it?So for exampleUser clicks on a link called "Older Stories"Once they do that, jquery will load in some content AJAX styleHowever, browser has jumped to the top of the page and we have to scroll back down again to see the content which has just been loaded in.I've tried putting a return statement in my code but it didn't do anythingHere's my code
var content = $("#ajax_content"); $("#olderstories").click(function(){ showLoading();
is there a way to popup a small 'bubble' or 'balloon' of text when a user lets their pointer rest over a particular part of an image? (an image map)
explorer does this sometime (randomly it seems) when i let my pointer rest of an image that has alt text - it displays the alt text in a speech bubble thing - but only sometimes! so that is no good. also netscape doesn't have this and obviously i want something that'll work in both.
the reason i want to do this is this - i've got a simplyfied map (a geographical map) as a picture. there's a small piece of info i wish to show for each country, but the map is too small to allow me to put the information directly on the map - so i figured popup bubbles would be a good way.
I used the "CreateBubblePopup", filling it with html directly in javascript. Until now, it was working fine. For some reasons, now I need to write this HTML inside the page (in a hidden div), and then load this html inside the bubble when it's created. Here is the code :
For each link I pull a few pieces of info for each, link name, link URL and a brief description. When a user clicks on the link I need to display a message that they are leaving the site and allow them to cancel or continue off the site. This can be either a bubble pop-up above/below the link or a modal window, displaying the 3 details (URL, Name, description) with an option to cancel and close the new bubble pop-up/modal window.
Yahoo News does an excellent job of the bubble pop-up but it's probably much more coding than I have time for. So my question is, is there code out there that I can implement on my site for this? I'm somewhat familiar with jQuery so if there's an existing example for this I'd love to hear about it.
I've built a gallery page with a popup bubble when you hover over a gate type, however this works fine on safari,firefox, but doesn't on explorer. [url]
I m trying to make a person stay on same page on cancel, but the confirm takes the user to the next page like they press ok. how can i stop it? code...
the problem is that when i move mouse into the "offer" div within the div i put my mouse from the div with "Add" over "Search" the onmouseout event is triggerd and the wtf() function is fired. and i want to fire wtf() only when i pull my mouse out of the whole "offer" (container) div.
I want to make it so that when I click on something, it changes what document.onclick does.
This is a simplified version of what I'm trying to do:
Code: <div id="clickme" onclick="document.onclick = function(){ alert ('This should not be alerted on the first click'); }">Click here</div>
However, as you'll notice, the alert box shows up on the first click as well. The only way I have been able to get around this behaviour is to have the first onclick execute a timer that will then set the document.onclick after 1ms, however this seems very messy to me.
I have a website that has an ad box to show the next event. after many hours i got the box to sit above a flash menu but it now floats and when people try to scroll to read the rest of the flyer it is always bellow the screen...
I'm using a countdown timer in a student project, and I use a simple code that I find on google. My problem is when the clock ends at 0 min 0 sec, it continue with the count. I want to stop when reach 0 min 0 sec. I show you the code.
i have a function, i want it to keep doing the function while the mouse is over a button and then stop when its off.....to repeat i can just call the function again at the end of the function like this:
onMouseOver="doFunction()"
doFunction() { //do something doFunction(); }
but how can i make a function stop to it onmouseout?
I'm trying to control the playback of 2 swf's, embedded in a html page.They should play or stop at the same time when a play or stop button is clicked.It has to do with that getElementById thing I guess, but I know very little javascript. Can anyone help me out with this?
what script goes above the <head> in my doc, and what code goes with the imagemaps?
In other words - linking the link that should open up 'thatlink.html' opens up that window first followed by the 'thislink.html' window in the table row onclick call.
I'm trying to determine if the user clicks the stop button during a post send, basically. Specifically, if a user is uploading a file to my server, and they click stop at some point, I need to be able to tell the server that stop was clicked, so it doesn't think that's the whole file. I've noticed that an error message is written to the Apache log, but that seems like a strange way to keep track of user-interrupted events. (Note: this is Apache/mod_perl server-side)
I guess what I'm thinking now is that JavaScript detects the stop (since it is client-side), then sends a message to the server that an error occurred, or something. Like I said, the onstop event is not doing what I'm expecting, and Firefox doesn't like it anyway, not to metion the other browsers out there. So my question is what's the "idiom" or "standard way" of detecting this sort of situation. I'm quite certain I'm not the first one to need it.