JQuery :: Stop Event Happening If Already Over Parent Element

Jul 5, 2011

I have a problem that suprisingly (not) only affects IE.

I have a hover/mouseover event when a users cursor enters a div, but because there is text inside my div IE is replaying the event if I hover in/out of the area that has text even though it is in the same div.

This is what I have:

Code:
$('.reason-1').mouseover(function(){
$('#first-r').stop(true, true).fadeIn(600);
$('#first-r-info').stop(true, true).delay(400).fadeIn(800);

[Code].....

how can I stop IE playing the action again if the user is still inside the same list element?

View 2 Replies


ADVERTISEMENT

How To Stop Events From Happening

May 31, 2007

I've been working on a multi-level drop down menu. It is already finished but while making it I encountered a problem that I'd like to find a solution for.

In the code, I clearly seperated the Model, View and Controller parts. The View part basically works with a single redraw-function. It clears the HTML of the complete drop-down menu and redraws it by recreating the needed DIV elements and adding them back to the webpage. The Controller part is a simple state machine that has transitions on onmouseover, onmouseout and onclick events.

In practice, when the mouse was moved over or out of some menuitem, the menu would be redrawn. The redraw function would first remove the complete menu from the HTML dom, and then re-insert the elements of the changed menu. Each of these elements contains a onmouseover and onmouseout argument.

The problem is as follows: in every redraw, when the menu is removed a onmouseout event is triggered, and when the menu is re-created a onmouseover event (in FFox). In IE, for some reason only a onmouseout event is triggered. This made my state machine think that the user actually moved the mouse pointer out of the menu element. Therefore the menu would go bananas and collapse!

The best way to solve this seems to simply ignore all of the user inputs during the redraw funtion for, say, 5 milliseconds during the redraw. However, in pratice, when the user moves the mouse very quickly the state machine 'misses' a mouseout event and the menu doesn't disappear as it should.

My question now is: does anybody know a neat way to prevent these 'ghost' events from happening while rebuilding the page, without interfering with the 'real' events?

View 1 Replies View Related

JQuery :: For An Action On A Element, Stop The Action On His Parent?

Dec 2, 2009

Is that possible when you click a child that the function on the parent don't run.

In these example, if I click on 'h2 > a
', both elements triggers functions ('h2' & 'a')
What I wan't is that if I click on 'h2 > a

[code]....

View 1 Replies View Related

JQuery :: Way To Highlight Element Inside Parent Element / When Mouse Hovers Over Child Element?

Oct 4, 2010

i have a menu generated by a list with nested lists. i want the parent link to stay highlighted when the mouse hovers over the sub menus. because those sub menus are also generated by jquery (qtip), CSS alone won't do it (triedul.topnav li:hover a {background-color: #F00;}).is there a way to do this using jquery?

View 15 Replies View Related

JQuery :: Element Overflows Containing Block When Parent Border/padding Change - Not When Parent's Margin Changes

Sep 24, 2011

Demonstration page: [url]

Adjust the CSS margins of the BODY element with the first slider. The yellow P (paragraph) element resizes to fit its smaller containing block, as I would expect.

Then, adjust the CSS border or padding of the BODY element with the second and third sliders. The P element does not resize, though its origin changes. Instead, it overflows its containing block.

Finally, adjust the margins again. The P element snaps back into its containing block.

As you can see from the source, this is jQuery 1.6.4 and jQueryUI 1.8 pulled from googleapis.com.

Edit: Client is Google Chrome16.0.889.0 dev-m.

View 2 Replies View Related

JQuery :: Stop The Click Event For A While

Jun 16, 2011

I have this code where takes the page a few seconds to load the page up.. in the meanwhile there are some links that I don't want any one to click..

View 1 Replies View Related

JQuery :: Capture And Event Only Once, And Then Stop From Re-Occurring?

Sep 6, 2010

'm trying to figure out how to do the following:capture a mousemove event over a div once (which triggers a function), and then once it has occurred prevent that event from occurring again. is it possible to do this? the code so far is simple:

$().ready(function() {
$('#theDiv').mouseover(function() {
myFunction();

[code]....

View 2 Replies View Related

JQuery :: Stop() On A Fading Element Don't Work?

Jan 31, 2010

I can't manage to stop an animation with stop() function.

Here's the code:

$('#test').mouseenter(function(){
$('#test .navigation').stop().fadeTo('normal',1);
});
$('#test').mouseleave(function(){
$('#test .navigation').stop().fadeTo('normal',0);
});

I don't know what's the problem, perhaps I'm not understanding stop().

View 2 Replies View Related

JQuery :: Manipulation Is Not Happening?

Aug 6, 2010

jQuery('div#primary').attr('width', '300'); I am manipulating html file. I am doing the above. But It is not updating the html file with the new width.

View 2 Replies View Related

JQuery :: Everything Is Happening At The Same Time - Not One After The Other?

Jul 11, 2011

I want to make a kind of slideshow with picture and text.The script at this moment:


$(document).ready(function () {
$("#BildLeiste0").show(2000).delay(8000).hide(2000);
$("#BildLeiste1").show(2000).delay(8000).hide(2000);

If I run the site, both animations run at the same time. I would like to achieve, that the animation atBildLeiste0 runs first and after it is completed the animationtBildLeiste1should start.If this runs the way I want, I want to make the script flexible from 2 two 6 animations and finally generate it so that it runs in an infinite loop.This is one of the first jquery-codes

View 2 Replies View Related

JQuery :: Stop Firing Change Event When Page Loaded?

Feb 23, 2010

Here's my code. when you load the page, alert shows up. is there a way to stop that? i only want alert to show when I change the selected item from dropdown list.[code]...

View 2 Replies View Related

IE: Unable To Modify The Parent Container Element Before The Child Element Is Closed

Mar 16, 2010

The bit of code in bold in the code below is giving me this error in IE: Error: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; Tablet PC 2.0; InfoPath.2; OfficeLiveConnector.1.4; .NET CLR 3.0.30729; OfficeLivePatch.1.3; MSN OptimizedIE8;ENGB)Timestamp: Tue, 16 Mar 2010 15:07:11 UTC Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)

[Code]....

View 1 Replies View Related

JQuery :: Original Element That Raised The Event If That Event Is Propagated Up The Tree?

Aug 19, 2011

how can i know the original element that raised the event if that event is propagated up the tree ?

View 6 Replies View Related

JQuery :: Event.stopPropagation() Is Preventing A Live Event On A Child Element

Jul 6, 2009

As far as I understood, stopPropagation() is supposed to stop events bubbling 'up' though the element tree (through parent elements). Eg. If I use stopPropagation() on a click event on an anchor element in a list, the event would not be triggered on the list. In my code I have a popup div, that needs to have stopPropagation(), as a click on the document (everywhere other than the popup) will hide it. When I add an element to the popup that has a live click event, the live click event is never called, even though it is a child element of the popup. Shouldn't the live click get called first? If I remove the stopPropagation all is well.. some code:

$('#a_test_link').live("click", function(e){
e.preventDefault();
alert('done!');
});

[Code].....

View 1 Replies View Related

JQuery :: Extra Callback Fired When Stop() Is Called On A Different Element?

May 29, 2011

I've been banging my head against this extremely frustrating bug but I finally managed to get an isolated test case. Call .animate() on two different elements one after the other and give the second one a "complete" callback. In the callback function call .stop() on the first element, the one with no callback.

The callback function should only fire once (when the second element's animation completes) but instead it fires twice. It only occurs when the animations are started in that order and stop() is called inside the callback.[URL]...

View 1 Replies View Related

JQuery :: Stopping Actions From Happening?

Aug 16, 2010

I have a text box where a user can press enter, tab (keypress) or click out of it (focusout) and an action happens. The box then gets removed. The problem is, the user presses enter, but that event is fired and then as the text box is removed the focus out is firing again.

How do I prevent removing the text box from firing the focusout action? I can remove the action totally but the text box could be returned to the document later.

View 3 Replies View Related

JQuery :: Make Element Click Event By Clicking On The Other Element?

Jul 29, 2011

I`m trying to make selecting an select list option (as it become when we click on it)by clicking on a special pseudo element.I`m trying to do it in this way:

<script>
$(document).ready(function(){
$(".psevdo-checkbox").each(function(){
$(this).click(function(){

[Code].....

View 6 Replies View Related

JQuery :: Put The Right Code In Place To Stop Event Bubbling On Menu Script?

Aug 14, 2011

I'mtryingto put the right code in place to stop event bubbling on my menu script. I have a the following code for the mouseenter event. I can't find where's appropraite to put stopPropagation()

menu_trigger is an array which is cycled through to put the mouseenter event onto the right <th> tags menu_objects is an array linking to the menu which should be shown.

[Code]...

View 1 Replies View Related

Jquery :: Get The Parent Element Value?

Dec 16, 2011

I have a table with a couple of rows with two cells in each row and each cell has couple of info like office name, address and phone number etc. Using jquery for each, the address is being pulled out from each cell and fed into google map geocoder object to get the point and plot it in the map. Now at each hit of an Address value, I would also like to grab the unique value of phone and office name from the current cell from which jquery is getting address value..I need those values so i can display those values in the InfoWindow of the map? How do I get those values?

<table class="OfficeInfo" border="0" style="width: 100%" cellspacing="10px" cellpadding="15px">
<tr>
<td class="Office1" style="width=40%">

[code]....

View 5 Replies View Related

Parent Event Works Through Child Event?

Jun 25, 2010

HTML Code:
<html>
<head>
<style type="text/css">[code]....

All i want to do is have the onclick fire when mouse clicks on the background only. Currently it fires when either element is clicking.( it fires through the foreground element)How to i prevent this while maintaining a child parent positioning relationship?

View 4 Replies View Related

JQuery :: Select The Next Element That Isn't Of The Same Parent?

Apr 17, 2010

I have:

<p>Click here</p>
<div>cool content #1</div>
<p>Click here</p>
<div>cool content #2</div>

How if I click either <p> how do I select the <div> immediately following?

$(p + div).dosomething()

isn't working.

View 3 Replies View Related

JQuery :: How To Find A Parent Element

Aug 13, 2009

I want to find the parent element of some element.

$("tr input").each(function (i) { //loop input elements within tr's
if(this.name == "cid[]"){
//checkbox

[code]....

View 2 Replies View Related

JQuery :: Move An Element To End Of It's Parent?

Jun 1, 2010

I have the following

<div id="container">
<div class="row">blah</div>
<div class="row">blah</div>
<div class="row">blah</div>
<div class="row">blah</div>
<div class="row">blah</div>
</div>

I would like to move the upper most row which I'm referencing by the eq: $('.row').eq(0) to the end of div#container I thought I could use append or appendTo, but these don't seem to be working.

View 3 Replies View Related

JQuery :: Select Only The Parent Element?

Oct 28, 2011

I use one outer div and a div as a child element

<div id="parent"><div>lorem ipsum</div></div>

and I need to register a click on the parent div. If I use

$("#parent")click(function(){
// my code
});

the code starts also if I click on the child div. So how can I start my function only if there was a click on the parent div outsite the child div?

View 5 Replies View Related

JQuery :: Select An Element's Parent?

Aug 1, 2009

I'm trying to update a script I found out there in order to fit better my needs. The first step I want to update is the capability to bind a dynamic number of anchors.

Right now with the HTML below

<ul id="product_links">
<li class="first" ><a>FIRST></a></li>
<li class="second">SECOND</a></li>
<li class="third"><a>THIRD</a></li>

[Code].....

View 5 Replies View Related

JQuery :: Get Parent Element Of Div Based On Div Content?

Nov 19, 2010

I try to get the parent element of a div based on the div content:

($('div:contains("' + BaseHtml + '")').parent().html();

where BaseHtml is the content of the div. but this always return null. How can I do?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved