Search Results

Search found 118 results on 5 pages for 'mouseup'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • Mouseup not working after mousemove on img

    - by leyou
    I'm trying to do a simple drag script. The idea is to save the position when the mouse is down, update the view while the mouse is moving, and stop when mouse is up. Problem, mouseup event isn't working properly. See the code: var target = $('a') var pos = 0; var dragging = false; $(document).mousedown(function(e) { pos=e.pageX; dragging = true }) $(document).mouseup(function() { dragging = false }) $(document).mousemove(function(e) { if(dragging){ target.css('left', e.pageX-pos); } }) ? Why mouseup works with a "a" tag: http://jsfiddle.net/leyou/c3TrG/1/ And why mouseup doesn't work with a "img" tag: http://jsfiddle.net/leyou/eNwzv/ Just try to drag them horizontally. Same probleme on ie9, ff and chrome.

    Read the article

  • I want to use blur function instead mouseup function

    - by yossi
    I have the Demo Table which I can click on the cell(td tag) and I can change the value on it.direct php DataBase. to do that I need to contain two tags.1 - span. 2 - input. like the below. <td class='Name'> <span id="spanName1" class="text" style="display: inline;"> Somevalue </span> <input type="text" value="Somevalue" class="edittd" id="inputName1" style="display: none; "> </td> to control on the data inside the cell I use in jquery .mouseup function. mouseup work but also make truble. I need to replace it with blur function but when I try to replace mouseup with blur the program thas not work becose, when I click on the cell I able to enter the input tag and I can change the value but I can't Successful to Leave the tag/field by clicking out side the table, which alow me to update the DataBase you can see that Demo with blur Here. what you advice me to do? $(".edittd").mouseup(function() { return false; }); //************* $(document).mouseup(function() { $('#span' + COLUME + ROW).show(); $('#input'+ COLUME + ROW ).hide(); VAL = $("#input" + COLUME + ROW).val(); $("#span" + COLUME + ROW).html(VAL); if(STATUS != VAL){ //******ajax code //dataString = $.trim(this.value); $.ajax({ type: "POST", dataType: 'html', url: "./public/php/ajax.php", data: 'COLUME='+COLUME+'&ROW='+ROW+'&VAL='+VAL, //{"dataString": dataString} cache: false, success: function(data) { $("#statuS").html(data); } }); //******end ajax $('#statuS').removeClass('statuSnoChange') .addClass('statuSChange'); $('#statuS').html('THERE IS CHANGE'); $('#tables').load('TableEdit2.php'); } else { //alert(DATASTRING+'status not true'); } });//End mouseup function I change it to: $(document).ready(function() { var COLUMES,COLUME,VALUE,VAL,ROWS,ROW,STATUS,DATASTRING; $('td').click(function() { COLUME = $(this).attr('class'); }); //**************** $('tr').click(function() { ROW = $(this).attr('id'); $('#display_Colume_Raw').html(COLUME+ROW); $('#span' + COLUME + ROW).hide(); $('#input'+ COLUME + ROW ).show(); STATUS = $("#input" + COLUME + ROW).val(); }); //******************** $(document).blur(function() { $('#span' + COLUME + ROW).show(); $('#input'+ COLUME + ROW ).hide(); VAL = $("#input" + COLUME + ROW).val(); $("#span" + COLUME + ROW).html(VAL); if(STATUS != VAL){ //******ajax code //dataString = $.trim(this.value); $.ajax({ type: "POST", dataType: 'html', url: "./public/php/ajax.php", data: 'COLUME='+COLUME+'&ROW='+ROW+'&VAL='+VAL, //{"dataString": dataString} cache: false, success: function(data) { $("#statuS").html(data); } }); //******end ajax $('#statuS').removeClass('statuSnoChange') .addClass('statuSChange'); $('#statuS').html('THERE IS CHANGE'); $('#tables').load('TableEdit2.php'); } else { //alert(DATASTRING+'status not true'); } });//End mouseup function $('#save').click (function(){ var input1,input2,input3,input4=""; input1 = $('#input1').attr('value'); input2 = $('#input2').attr('value'); input3 = $('#input3').attr('value'); input4 = $('#input4').attr('value'); $.ajax({ type: "POST", url: "./public/php/ajax.php", data: "input1="+ input1 +"&input2="+ input2 +"&input3="+ input3 +"&input4="+ input4, success: function(data){ $("#statuS").html(data); $('#tbl').hide(function(){$('div.success').fadeIn();}); $('#tables').load('TableEdit2.php'); } }); }); }); Thx

    Read the article

  • jquery draggable throws error when 'mouseup' is triggered

    - by Moustard
    If you build a simple dragger: $(document).ready( function() { $('#tomove').draggable( { axis: 'x', drag: function(event, ui) { mouseUp(); } }); } ); And you try to stop it programmatically: function mouseUp() { if($('#tomove').offset().left 400) { $('#tomove').trigger('mouseup'); } } You will get this message in error console: this.helper is null Is there any way to fix this? Thanks for your help.

    Read the article

  • jquery: problem with unbinding mousenter() upon mouseup()

    - by Haroldo
    I'm building an interface for marking dates on a calendar as being booked. The user 'paints' on the dates they want to mark as booked. here's how it looks: here are the functions: function load_red_paint(){ $('td').bind('mousedown', function(){ $(this).addClass('booked'); $('td').bind('mouseenter', function(){ $(this).addClass('booked'); }); unbind_brush(); }) } function unbind_brush(){ $('td').bind('mouseup', function(){ $('td').unbind('mouseenter'); }); $('table').bind('mouseleave', function(){ $('td').unbind('mouseenter'); }); } the problem: My unbind_brush() function works great except for if the user mouseup's outside of the calendar, i tried to fix this my also unbinding on mouseleave of that calendar with this bit: $('table').bind('mouseleave', function(){ $('td').unbind('mouseenter'); }); but with no joy, am i missing something obvious?!!!

    Read the article

  • Javascript Detect Control Key Held on Mouseup

    - by Michael Mikowski
    I've searched a good deal, and can't seem to find a satisfactory solution. I hope someone can help. While I am using jQuery, I am also writing many thousands of lines of Javascript. So a "pure" javascript solution is just fine. I'm trying to determine if the control key is physically held down on a mouseup event. That's it; there are no other preconditions. Does anyone know how to do this reliably, cross-browser? I've tried storing this in a state variable by noting when the key is pressed and released: // BEGIN store control key status in hash_state $().bind('keydown','ctrl',function( arg_obj_e ){ hash_state.sw_ctrldn = true; console.debug( hash_state.sw_ctrldn ); }); $().bind('keyup','ctrl',function( arg_obj_e ){ hash_state.sw_ctrldn = false; console.debug( hash_state.sw_ctrldn ); }); // END store control key status in hash_state However, this really doesn't work. If you test this using firebug and watch the console, you will see that auto-repeat seems to happen, and the value toggles. I inspected the mouseup event to see if there is anything useful there, but to no avail: var debugEvent = function( arg_obj_e ){ var str = ''; for ( var attr in arg_obj_e ){ str += attr + ': ' + arg_obj_e[attr] + '\n'; } console.debug(str); } Any help would be appreciated.

    Read the article

  • jquery hover event between mousedown and mouseup - possible?

    - by Haroldo
    If you imagine in microsoft paint you can click and hold to paint in an area, id like to do a similar but adding a class to cells in a table: (note this isnt for painting/art just an easy way of explaining it!) the following isnt working... $(function(){ $('td').mousedown(function(){ console.log('down'); $('td').bind('hover', function(){ $(this).addClass('booked'); }); }) $('td').mouseup(function(){ $('td').unbind('hover'); }); })

    Read the article

  • When dragged and on mouseup/mouseleave in the document I want to call my Ajax request

    - by Sappy
    For slider range - when dragged and on mouseup/mouseleave in the document I want to call my Ajax request. Explained: When I mousedown to slide my slider I want to say isDown = "true" But it doesn't works. Can anyone please help me with this and let me know how do I achieve this. // Default isDown = false $("#slider-range").find('a').mousedown(function(){ isDown=true; console.log(isDown); // It works here! }); console.log(isDown); // It doesn't works here if(isDown) { $(document).onmouseup(function() { return setAjaxRequest(); isDown = false; }); }

    Read the article

  • Having an issue wit mouseup event

    - by user3680715
    Hello everyone I have this code working fine but I want the script to stop on the mouse up event. Here is an example of what I have now. How can I stop the script on mouse up event so that it looks like it only shows the coordinates when dragging over the image. Thank you! http://jsfiddle.net/Hc7x4/20/ $(document).ready(function () { $("#map-catcher").mousedown(function (e) { $("#map-catcher").mousemove(function (e) { $("#coord").text("x:"+e.offsetX+", y:"+e.offsetY); return; }); $("#map-catcher").mouseup(function (e) { return; }); }); });

    Read the article

  • svg mouseup event not fired in IE9, unless the debugger is open

    - by Roberto Lupi
    I am using d3 to build a simple chart that the user can edit interactively with the mouse. It works on in all modern common browser (Chrome, Firefox, Safari), except for Internet Explorer 9 where I can start to drag an item but I never get the mouseup event. The strangest bit is that, if I open the debugger, the page works percetly on Internet Explorer 9 as well. My code looks like this: item.append("svg:circle") .attr("class", "handle") .attr("opacity",0.5) .attr("stroke","gray") .attr("cx", bx(0.5)-bx(0)) .attr("r", 10) .style("cursor", "crosshair") .style("pointer-events", "all") .call(d3.behavior.drag() .on("dragstart", function() { dragTarget = d3.select(this); }) .on("drag", function() { this.parentNode.appendChild(this); // put us on the front, not really needed var dragTarget = d3.select(this); dragTarget .attr("cy", function() { return d3.event.dy + parseInt(dragTarget.attr("cy"))}); }) .on("dragend", function(d, i) { newY = parseInt(d3.select(this).attr("cy")); newValue = y.invert(newY); var serieNo = this.__data__.serieNo; console.log([serieNo+1,i+1]); data[serieNo+1][i+1] = newValue; updateBarChart(); onchange(); }) );

    Read the article

  • [Adobe Air] Can I catch a mouseUp event of an mx:Window that did not fire hte mouseDown?

    - by Irene
    Hi, In an AIR application, I have one mx:TileList with several images. What I need to do is let the user drag and drop one of the images on the desktop, giving a feeling of a desktop widget. Firstly I tried to implement this using dragStart etc, but in the end I think it is easier to handle mouseDown and mouseUp on the TileList. In general the whole setup works as desired. When a mouseDown is detected on the TileList, I create a transparent mx:Window containing the corresponding image, and call the startMove() on the Window to simulate a dragging behavior. If I release the mouse, the Window stops moving as desired. My problem is that now I want some visual feedback during dragging. It works while the Window is moving, however I can't find a way to stop it when the user releases the mouse. The mouseUp is not fired from the TileList, nor from the s:WindowedApplication. I also tried to add a listener to the Window itself, but still with no luck. Some code: private function onMouseDown(e:MouseEvent):void { trace ("down " + e.target); if (e.target is TileListItemRenderer) { // first create a dragWindow dragWindow.startGlow(); // then show some visual feedback dragWindow.moveWindow(e); // and start dragging } } private function onMouseUp(e:MouseEvent):void { trace("up " + e.target); dragWindow.stopGlow(); // <--------- Not called! } <mx:TileList id="photoTileList" mouseDown="onMouseDown(event)" mouseUp="onMouseUp(event)">

    Read the article

  • OSX Lion - Stuck in Drag mode and mouse click events are not going through. Can I manually generate a mouseup event?

    - by Yuji Tomita
    My mouse is stuck in "drag" mode. This generally happens in Photoshop, but happens dragging files and such as well. Clicking rapidly here and there generally solves the problem. Sometimes though, it won't go away until a restart. Unplugging devices, etc., doesn't do anything. For example, right now, my mouse moves but can not click anything so I am using the keyboard to navigate this site. Is there a way to "reset" however the OS stores mouse states? Can I manually fire off a MouseUp event? It's strange that even when human input devices are unplugged, the files are still in drag state.

    Read the article

  • .NET Programmatically invoke screenclick doesn't work?

    - by ropstah
    I'm trying to programmatically invoke an onclick event however the click is not received/handled. Am I missing something, or is security preventing the click to be executed? I have a forms application which is invisible. Basically I would like to say: DoDoubleClick(wait, x, y) This should raise two click (mousedown+mouseup) events on screen with the specified wait interval. However the click isn't received in a Flash application in Firefox (which is running at that moment). Here's my code: Form: Public Class Form1 Private WithEvents gmh As GlobalMouseHook Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load gmh = New GlobalMouseHook() Me.Visible = false gmh.DoDoubleClick(50, 800, 600) End Sub Private Sub Form1_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed gmh.Dispose() End Sub Private Sub gmh_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gmh.MouseDown End Sub Private Sub gmh_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gmh.MouseMove End Sub Private Sub gmh_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gmh.MouseUp End Sub End Class GlobalMouseHook class: Friend Class GlobalMouseHook Implements IDisposable Private hhk As IntPtr = IntPtr.Zero Private disposedValue As Boolean = False Public Event MouseDown As MouseEventHandler Public Event MouseUp As MouseEventHandler Public Event MouseMove As MouseEventHandler Public Sub New() Hook() End Sub Private Sub Hook() Dim hInstance As IntPtr = LoadLibrary("User32") hhk = SetWindowsHookEx(WH_MOUSE_LL, AddressOf Me.HookProc, hInstance, 0) End Sub Private Sub Unhook() UnhookWindowsHookEx(hhk) End Sub Public Sub DoDoubleClick(ByVal wait As Integer, ByVal x As Integer, ByVal y As Integer) RaiseEvent MouseDown(Me, New MouseEventArgs(MouseButtons.Left, 1, x, y, 0)) RaiseEvent MouseUp(Me, Nothing) System.Threading.Thread.Sleep(wait) RaiseEvent MouseDown(Me, New MouseEventArgs(MouseButtons.Left, 1, x, y, 0)) RaiseEvent MouseUp(Me, Nothing) End Sub Private Function HookProc(ByVal nCode As Integer, ByVal wParam As UInteger, ByRef lParam As MSLLHOOKSTRUCT) As Integer If nCode >= 0 Then Select Case wParam Case WM_LBUTTONDOWN RaiseEvent MouseDown(Me, New MouseEventArgs(MouseButtons.Left, 0, lParam.pt.x, lParam.pt.y, 0)) Case WM_RBUTTONDOWN RaiseEvent MouseDown(Me, New MouseEventArgs(MouseButtons.Right, 0, lParam.pt.x, lParam.pt.y, 0)) Case WM_MBUTTONDOWN RaiseEvent MouseDown(Me, New MouseEventArgs(MouseButtons.Middle, 0, lParam.pt.x, lParam.pt.y, 0)) Case WM_LBUTTONUP, WM_RBUTTONUP, WM_MBUTTONUP RaiseEvent MouseUp(Nothing, Nothing) Case WM_MOUSEMOVE RaiseEvent MouseMove(Nothing, Nothing) Case WM_MOUSEWHEEL, WM_MOUSEHWHEEL Case Else Console.WriteLine(wParam) End Select End If Return CallNextHookEx(hhk, nCode, wParam, lParam) End Function Private Structure API_POINT Public x As Integer Public y As Integer End Structure Private Structure MSLLHOOKSTRUCT Public pt As API_POINT Public mouseData As UInteger Public flags As UInteger Public time As UInteger Public dwExtraInfo As IntPtr End Structure Private Const WM_MOUSEWHEEL As UInteger = &H20A Private Const WM_MOUSEHWHEEL As UInteger = &H20E Private Const WM_MOUSEMOVE As UInteger = &H200 Private Const WM_LBUTTONDOWN As UInteger = &H201 Private Const WM_LBUTTONUP As UInteger = &H202 Private Const WM_MBUTTONDOWN As UInteger = &H207 Private Const WM_MBUTTONUP As UInteger = &H208 Private Const WM_RBUTTONDOWN As UInteger = &H204 Private Const WM_RBUTTONUP As UInteger = &H205 Private Const WH_MOUSE_LL As Integer = 14 Private Delegate Function LowLevelMouseHookProc(ByVal nCode As Integer, ByVal wParam As UInteger, ByRef lParam As MSLLHOOKSTRUCT) As Integer Private Declare Auto Function LoadLibrary Lib "kernel32" (ByVal lpFileName As String) As IntPtr Private Declare Auto Function SetWindowsHookEx Lib "user32.dll" (ByVal idHook As Integer, ByVal lpfn As LowLevelMouseHookProc, ByVal hInstance As IntPtr, ByVal dwThreadId As UInteger) As IntPtr Private Declare Function CallNextHookEx Lib "user32" (ByVal hhk As IntPtr, ByVal nCode As Integer, ByVal wParam As UInteger, ByRef lParam As MSLLHOOKSTRUCT) As Integer Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hhk As IntPtr) As Boolean ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not Me.disposedValue Then If disposing Then ' TODO: free other state (managed objects). End If Unhook() End If Me.disposedValue = True End Sub ' This code added by Visual Basic to correctly implement the disposablepattern. Public Sub Dispose() Implements IDisposable.Dispose ' Do not change this code. Put cleanup code in Dispose(ByValdisposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) End Sub End Class

    Read the article

  • Pass an event into a constructor

    - by Vaccano
    I have a class that I want to be able the handle the mouse up event for a grid. I tried to create it with a static method call like this: MyDataBinding.BindObjectsToDataGrid(ListOfObjectsToBind, myGrid.MouseUp); The end goal being that in the method I would assign a delegate to the MouseUp PassedInMouseUp += myMethodThatWillHandleTheMouseUp; Looks good here (to me) but the compiler chokes on the first line. It says that I can only use MouseUp with a += or a -=. Clearly I am going about this the wrong way. How can I get a different class to handle the mouse up with out having to: Pass in the whole grid Expose the method that will be handling the mouse up as a public method. Or, is this just a limitation and I will have to do one of the above?

    Read the article

  • What's the best way to structure this Linq-to-Events Drag & Drop code?

    - by Rob Fonseca-Ensor
    I am trying to handle a drag & drop interaction, which involves mouse down, mouse move, and mouse up. Here is a simplified repro of my solution that: on mouse down, creates an ellipse and adds it to a canvas on mouse move, repositions the ellipse to follow the mouse on mouse up, changes the colour of the canvas so that it's obvious which one you're dragging. var mouseDown = Observable.FromEvent<MouseButtonEventArgs>(canvas, "MouseLeftButtonDown"); var mouseUp = Observable.FromEvent<MouseButtonEventArgs>(canvas, "MouseLeftButtonUp"); var mouseMove = Observable.FromEvent<MouseEventArgs>(canvas, "MouseMove"); Ellipse ellipse = null; var q = from start in mouseDown.Do(x => { // handle mousedown by creating a red ellipse, // adding it to the canvas at the right position ellipse = new Ellipse() { Width = 10, Height = 10, Fill = Brushes.Red }; Point position = x.EventArgs.GetPosition(canvas); Canvas.SetLeft(ellipse, position.X); Canvas.SetTop(ellipse, position.Y); canvas.Children.Add(ellipse); }) from delta in mouseMove.Until(mouseUp.Do(x => { // handle mouse up by making the ellipse green ellipse.Fill = Brushes.Green; })) select delta; q.Subscribe(x => { // handle mouse move by repositioning ellipse Point position = x.EventArgs.GetPosition(canvas); Canvas.SetLeft(ellipse, position.X); Canvas.SetTop(ellipse, position.Y); }); the XAML is simply <Canvas x:Name="canvas"/> There's a few things I don't like about this code, and I need help refactoring it :) First of all: the mousedown and mouseup callbacks are specified as side effects. If two subscriptions are made to q, they will happen twice. Second, the mouseup callback is specified before the mousemove callback. This makes it a bit hard to read. Thirdly, the reference to the ellipse seems to be in a silly place. If there's two subscriptions, that variable reference will get overwritten quite quickly. I'm sure that there should be some way we can leverage the let keyword to introduce a variable to the linq expression that will mean the correct ellipse reference is available to both the mouse move and mouse up handlers How would you write this code?

    Read the article

  • WPF: Image cilck event

    - by user279244
    I can find only MouseDown Event and MouseUp Event on a image in WPF. This causes some problem if I do MouseDown on some Image, Move the mouse and MouseUp event happens on some other image. Is there any other event that I can use to solve this problem. like MouseClick Event for Button element.

    Read the article

  • MouseUpEvent stops working while Dragging MovieClip

    - by Arslan
    There is a mouseUpEvent listener attached to the stage, while dragging the movieClip the mouseUpEvent doesnot trigger the handler somehow the mouseUp gets lost. While the item is being dragged and the mouse is moved away from the movieClip i.e somewhere not on the item but on the stage the mouseUp is detected. Any ideas!!

    Read the article

  • jQuery Manual Resizable DIV

    - by JC
    Hi, I'm trying to create a resizable div without using jQuery's interface library. var myY = 0; var mouseDown = false; var originalHeight = 0; function resize(e){ if(mouseDown == true){ $("#cooldiv").height(originalHeight+e.pageY-myY); } } $(document).ready(function(){ $().mouseup(function(e){ myY = 0; mouseDown = false; originalHeight = 0; $().unbind("mousemove", resize); }); $("#resizeBar").mousedown(function(e){ myY = e.pageY; originalHeight = $("#cooldiv").height(); mouseDown = true; $().bind("mousemove", resize); }); }); ... <div id="cooldiv" style="width: 500px; height: 300px; background-color: #cccccc; position: relative;"> <div id="resizeBar" style="height: 10px; width: 500px; background-color: #aaaaaa; position: absolute; bottom: 0;"></div> </div> The first resize works fine(i.e. mousedown, mousemove then mouseup), but on subsequent (mousedown+mousemove)s, the browser attempts to drag the whole resizeBar div instead of properly resizing its parent container. On mouseup, the div then starts resizing "cooldiv" on mousemove without any mousedown required, until a further click of the mouse. These problems don't show up in Internet Explorer.

    Read the article

  • Big task - problems with page refresh and ajax

    - by user1830414
    I have a navigation which load dynamically content via ajax. But if I refresh the page or visit another url and go back the current content is away and I see the old content under the first menu tab. Now I have to solve this problem. The index.php include the elements header_registrated.inc.php, navigation.inc.php and main_container.inc.php index.php: <?php include("inc/incfiles/header_registrated.inc.php"); ?> <?php if (!isset($_SESSION["userLogin"])) { echo "<meta http-equiv=\"refresh\" content=\"0; url=http://localhost/project\">"; } else { echo ""; } ?> <?php include("inc/incfiles/navigation.inc.php"); ?> <?php include("inc/incfiles/main_container.inc.php"); ?> <?php include("inc/incfiles/footer.inc.php"); ?> header_registrated.inc.php: <?php include ("inc/scripts/mysql_connect.inc.php"); session_start(); $user = $_SESSION["userLogin"]; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>title</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <script language="JavaScript" src="js/framework/jquery.js"></script> <script language="JavaScript" src="js/dropdown/window.js"></script> <script language="JavaScript" src="js/navigation/navigation.js"></script> </head> <body> </body> navigation.inc.php: <div class="navigation"> <ul> <li id="1"> <div id="menuImage1" class="menuImage"></div> <div class="menuText"><p>Punkt 1</p></div> <div class="navigationDart"></div> </li> <li id="2"> <div id="menuImage2" class="menuImage"></div> <div class="menuText"><p>Punkt 2</p></div> </li> <li id="3"> <div id="menuImage3" class="menuImage"></div> <div class="menuText"><p>Punkt 3</p></div> </li> <li id="4"> <div id="menuImage4" class="menuImage"></div> <div class="menuText"><p>Punkt 4</p></div> </li> <li id="5"> <div id="menuImage5" class="menuImage"></div> <div class="menuText"><p>Punkt 5</p></div> </li> <li id="6"> <div id="menuImage6" class="menuImage"></div> <div class="menuText"><p>Punkt 6</p></div> </li> </ul> </div> main_container.inc.php: <div class="mainContainer"> <div class="containerHeader"> <div class="contentHeader"> </div> </div> <div class="contentContainer"> <div class="content"> </div> <div class="advertisement"> </div> </div> </div> Now the divs content, cnotentHeader and advertisement (in file main_content.inc.php) is filled via ajax. Also the navigation has some jquery effects which also have to be the same after page refresh. navigation.js: $(document).ready(function() { $.get('inc/incfiles/content_container/header/1.php', function(data) { $('.contentHeader').html(data); }); $.get('inc/incfiles/content_container/content/1.php', function(data) { $('.content').html(data); }); $.get('inc/incfiles/content_container/advertisement/1.php', function(data) { $('.advertisement').html(data); }); var current = '1.php'; $(".navigation li").click(function() { var quelle = $(this).attr('id') + ".php"; // the current content doesn't load again if(current === quelle) { return; } current = quelle; // content $(".content").fadeOut(function() { $(this).load("inc/incfiles/content_container/content/" + quelle).fadeIn('normal'); }) // advertisement $(".advertisement").fadeOut(function() { $(this).load("inc/incfiles/content_container/advertisement/" + quelle).fadeIn('normal'); }) // header $(".contentHeader").fadeOut(function() { $(this).load("inc/incfiles/content_container/header/" + quelle).fadeIn('normal'); }) }); $(".navigation li").click(function() { $(".menuImage").removeClass("menuImageActive1"); $(".menuImage").removeClass("menuImageActive2"); $(".menuImage").removeClass("menuImageActive3"); $(".menuImage").removeClass("menuImageActive4"); $(".menuImage").removeClass("menuImageActive5"); $(".menuImage").removeClass("menuImageActive6"); }); $("#1").mousedown(function() { $("#menuImage1").addClass("menuImageClick1"); // new class on mouse button press }); $("#1").mouseup(function() { $("#menuImage1").removeClass("menuImageClick1"); //remove class after mouse button release }); $("#1").click(function() { $("#menuImage1").addClass("menuImageActive1"); }); $("#2").mousedown(function() { $("#menuImage2").addClass("menuImageClick2"); // new class on mouse button press }); $("#2").mouseup(function() { $("#menuImage2").removeClass("menuImageClick2"); //remove class after mouse button release }); $("#2").click(function() { $("#menuImage2").addClass("menuImageActive2"); }); $("#3").mousedown(function() { $("#menuImage3").addClass("menuImageClick3"); // new class on mouse button press }); $("#3").mouseup(function() { $("#menuImage3").removeClass("menuImageClick3"); //remove class after mouse button release }); $("#3").click(function() { $("#menuImage3").addClass("menuImageActive3"); }); $("#4").mousedown(function() { $("#menuImage4").addClass("menuImageClick4"); // new class on mouse button press }); $("#4").mouseup(function() { $("#menuImage4").removeClass("menuImageClick4"); //remove class after mouse button release }); $("#4").click(function() { $("#menuImage4").addClass("menuImageActive4"); }); $("#5").mousedown(function() { $("#menuImage5").addClass("menuImageClick5"); // new class on mouse button press }); $("#5").mouseup(function() { $("#menuImage5").removeClass("menuImageClick5"); //remove class after mouse button release }); $("#5").click(function() { $("#menuImage5").addClass("menuImageActive5"); }); $("#6").mousedown(function() { $("#menuImage6").addClass("menuImageClick6"); // new class on mouse button press }); $("#6").mouseup(function() { $("#menuImage6").removeClass("menuImageClick6"); //remove class after mouse button release }); $("#6").click(function() { $("#menuImage6").addClass("menuImageActive6"); }); $("#1").click(function(){ $(".navigationDart").animate({ top: "16px" }, 500 ); }); $("#2").click(function(){ $(".navigationDart").animate({ top: "88px" }, 500 ); }); $("#3").click(function(){ $(".navigationDart").animate({ top: "160px" }, 500 ); }); $("#4").click(function(){ $(".navigationDart").animate({ top: "232px" }, 500 ); }); $("#5").click(function(){ $(".navigationDart").animate({ top: "304px" }, 500 ); }); $("#6").click(function(){ $(".navigationDart").animate({ top: "376px" }, 500 ); }); }); My idea was it to work with if(isset($_SESSION['ajaxresponse'])) but I don't no how to do this. Please help me. I have the feeling that I've searched the whole web to find an answer.

    Read the article

  • MacBook Pro Trackpad freeze / holds click on its own

    - by lajuette
    My MacBook Pro's Trackpad shows an annoying behavior in the last few days. I think the only relevant thing that changed is the firmware for the Trackpad. An update has been distributed via Software Update a few days ago. Sometimes when i click somewhere the Trackpad won't recognize the mouseup, i.e. hold the click on its own. Clicking again seems to stop the holding and issue a new mousedown, but then again, no mouseup I.e. when i click on a file on the desktop the file will be dragged. But i can't stop dragging! Clicking in a browser or text document will select the text/images. Did anyone notice similar behavior? Any ideas or fixes?

    Read the article

  • jQuery .append() not working in IE, Safari, and Chrome

    - by mkmcdonald
    So I'm using jQuery's AJAX function to read some XML for me and it's worked just fine. But now I'm trying to manipulate the display property of 4 different dynamically generated divs. The size and x/y of the divs are determined by the XML and are parsed through. My problem lies in the face that these divs either aren't being generated or just don't show up in IE, Safari, and Chrome. In Firefox and Opera, they do work. I'm using jQuery's .append() to create the divs and then the .css() functino to manipulate them. Looking in Chrome's developer tools, I am seeing that the css property being changed in the script is being overridden by the property in the stylesheet. Any fixes? $(document).ready(function(){ $.ajax({ type: "GET", url: "generate?test", dataType: "xml", success: function(xml) { $(xml).find('template').each(function(){ var portion = $(this).attr('portion'); var select; var name = $(this).find('$(this):first').text(); var mutability = $(this).attr('mutability'); var x = (parseInt($(this).find('x:first').text())*96)/72; var y = (parseInt($(this).find('y:first').text())*96)/72; switch(portion){ case "stub": select = $('#StubTemplates'); select.append(""+name+""); break; case "body": select = $('#BodyTemplates'); select.append(""+name+""); y = y + 90; break; } switch(mutability){ case "dynamic": var width = (parseInt($(this).find('width:first').text())*96)/72; var height = (parseInt($(this).find('height:first').text())*96)/72; var n = name; switch(portion){ case "stub": $('.ticket').append("") break; case "body": $('.ticket').append(""); break; } var top = $('#'+n).position().top; var left = parseInt($('#'+n).css('margin-left')); $('#'+n).css('top', (y+top)+"px"); $('#'+n).css('margin-left', (x+left)+"px"); $('#'+n).css('width', width+"px"); $('#'+n).css('height', height+"px"); break; case "static": var n = name; switch(portion){ case "stub": $('.ticket').append(""); break; case "body": $('.ticket').append(""); break; } break; } }); var stubActive = false; var bodyActive = false; $('#StubTemplates').find('.ddindent').mouseup(function(){ var tVal = $(this).val(); var tTitle = $(this).attr('title'); if(!stubActive){ $('.stubEditable').css('display', 'none'); $('#'+tVal).css('display', 'block'); stubActive = true; }else{ $('.stubEditable').css('display', 'none'); $('#'+tVal).css('display', 'block'); stubActive = false; } }); $('#StubTemplates').find('#stubTempNone').mouseup(function(){ $('.stubEditable').css('display', 'none'); }); $('#BodyTemplates').find('.ddindent').mouseup(function(){ var tVal = $(this).val(); var tTitle = $(this).attr('title'); if(!bodyActive){ $('.bodyEditable').css('display', 'none'); $('#'+tVal).css('display', 'block'); bodyActive = true; }else{ $('.bodyEditable').css('display', 'none'); $('#'+tVal).css('display', 'block'); bodyActive = false; } }); $('#BodyTemplates').find('#bodyTempNone').mouseup(function(){ $('.bodyEditable').css('display', 'none'); }); } }); });

    Read the article

  • Custom NSView in NSMenuItem not receiving mouse events

    - by Dennis
    I have an NSMenu popping out of an NSStatusItem using popUpStatusItemMenu. These NSMenuItems show a bunch of different links, and each one is connected with setAction: to the openLink: method of a target. This arrangement has been working fine for a long time. The user chooses a link from the menu and the openLink: method then deals with it. Unfortunately, I recently decided to experiment with using NSMenuItem's setView: method to provide a nicer/slicker interface. Basically, I just stopped setting the title, created the NSMenuItem, and then used setView: to display a custom view. This works perfectly, the menu items look great and my custom view is displayed. However, when the user chooses a menu item and releases the mouse, the action no longer works (i.e., openLink: isn't called). If I just simply comment out the setView: call, then the actions work again (of course, the menu items are blank, but the action is executed properly). My first question, then, is why setting a view breaks the NSMenuItem's action. No problem, I thought, I'll fix it by detecting the mouseUp event in my custom view and calling my action method from there. I added this method to my custom view: - (void)mouseUp:(NSEvent *)theEvent { NSLog(@"in mouseUp"); } No dice! This method is never called. I can set tracking rects and receive mouseEntered: events, though. I put a few tests in my mouseEntered routine, as follows: if ([[self window] ignoresMouseEvents]) { NSLog(@"ignoring mouse events"); } else { NSLog(@"not ignoring mouse events"); } if ([[self window] canBecomeKeyWindow]) { dNSLog((@"canBecomeKeyWindow")); } else { NSLog(@"not canBecomeKeyWindow"); } if ([[self window] isKeyWindow]) { dNSLog((@"isKeyWindow")); } else { NSLog(@"not isKeyWindow"); } And got the following responses: not ignoring mouse events canBecomeKeyWindow not isKeyWindow Is this the problem? "not isKeyWindow"? Presumably this isn't good because Apple's docs say "If the user clicks a view that isn’t in the key window, by default the window is brought forward and made key, but the mouse event is not dispatched." But there must be a way do detect these events. HOW? Adding: [[self window] makeKeyWindow]; has no effect, despite the fact that canBecomeKeyWindow is YES.

    Read the article

  • disable event-bubbling c# wpf

    - by Ruben
    Hi, I'm having the following problem: When I got two labels into each other: <Label x:Name="First" MouseUp="Label_MouseUp"> <Label x:Name="Second" MouseUp="Label_MouseUp_1">This is a label into another label</Label> </Label> And the following code: private void Label_MouseUp(object sender, MouseButtonEventArgs e) { Console.WriteLine("Do NOT show me"); } private void Label_MouseUp_1(object sender, MouseButtonEventArgs e) { Console.WriteLine("Show me"); } When i click "Second", I want it to trigger only "Label_MouseUp_1". But in my console i get: Show me Do NOT show me Is there a way to turn off the bubbling events? (also, "First" has to be clickable, so removing the event there doesn't solve the problem) Thnx

    Read the article

  • Is there a way to determine if a <select> dropdown menu is open?

    - by Robert
    I'm looking for a way to determine if/when a <select> element's menu is open. I don't need to force it to open or close, just figure out if it's open or closed at a given time. I can listen to events for focus/blur, mouseup/mousedown, etc., but I don't think I can reliably figure out the state of the menu from those events. For example, mousedown followed by mouseup could mean the user clicked and dragged to a selection and released (in which case the menu is now closed) or clicked and released to open the menu (in which case the menu is open). It also seems likely that the specific behavior of dropdown menus is browser-dependent. I know I could do this if I roll my own dropdown menu, but I prefer to use <select>. Is there a reliable way to find out if a dropdown menu is open? Or is this something that Javascript can't know?

    Read the article

  • Detecting extended mousedown event on iPhone

    - by Alan Neal
    I want to detect an extended mousedown. The following code works in Firefox and Safari... var mousedownTimeout; $('#testButton').mousedown(function(){ mousedownTimeout = window.setTimeout(function(){ alert("Hey, let go."); }, 2000); }); $('#testButton').mouseup(function(){ window.clearTimeout(mousedownTimeout); }); ... but not on the iPhone because (quoting quirksmore.org)... The iPhone fires the mousedown, mouseup and click events in the correct order on a click (tap), but it either fires all three or none at all. Is there a way around this?

    Read the article

  • What's special about mouse capture and middle mouse button in WPF?

    - by Scott Bilas
    When I call CaptureMouse() in response to a MouseDown from the middle mouse button, it will capture and then release the mouse. Huh? I've tried using Preview events, setting Handled=true, doesn't make a difference. Am I not understanding mouse capture in WPF? Here's some minimal sample code that reproduces the problem. // TestListBox.cs using System.Diagnostics; using System.Windows.Controls; namespace Local { public class TestListBox : ListBox { public TestListBox() { MouseDown += (_, e) => { Debug.WriteLine("+MouseDown"); Debug.WriteLine(" Capture: " + CaptureMouse()); Debug.WriteLine("-MouseDown"); }; MouseUp += (_, e) => { Debug.WriteLine("+MouseUp"); ReleaseMouseCapture(); Debug.WriteLine("-MouseUp"); }; GotMouseCapture += (_, e) => Debug.WriteLine("GotMouseCapture"); LostMouseCapture += (_, e) => Debug.WriteLine("LostMouseCapture"); } } } Generating a default WPF app that has this for its main window will use the test class: <Window x:Class="Local.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Local" Title="MainWindow" Height="350" Width="525"> <local:TestListBox> <ListBoxItem>1</ListBoxItem> <ListBoxItem>2</ListBoxItem> <ListBoxItem>3</ListBoxItem> <ListBoxItem>4</ListBoxItem> </local:TestListBox> </Window> Upon clicking the middle button down, I get this output: +MouseDown GotMouseCapture LostMouseCapture Capture: True -MouseDown So I'm calling CaptureMouse, which in turn grabs and then releases capture, yet returns true that capture was successfully acquired. What's going on here? Is it possible that this is something with my Logitech mouse driver doing something goofy, trying to initiate 'ultrascroll' or something?

    Read the article

1 2 3 4 5  | Next Page >