mouseevent

How to bring drop shadow effect for a div on mouseover using jQuery / Javascript

人盡茶涼 提交于 2019-12-12 14:20:18
问题 I have many divs in an html page. I need to give these divs a drop shadow effect on mouseover using jQuery/Javascript. I can get it work if the drop shadow is to be applied initially but I am not able to get it work at the run time. The divs which needs to have shadow applied has a common class. In the fiddle it is test. I have created a fiddle http://jsfiddle.net/bobbyfrancisjoseph/ZEuVE/2/ It should work on IE8 and above and so I guess CSS3 can be used. 回答1: use this css for the shadow

Scrolling canvas content

对着背影说爱祢 提交于 2019-12-12 13:21:11
问题 I have drawn some text and rectangles on canvas. package com.cavium.test.views; import org.eclipse.swt.SWT; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.ScrollBar; import org.eclipse.swt.widgets.Shell; public class Test2

Position of mouse click relative to scene, not window

有些话、适合烂在心里 提交于 2019-12-12 12:48:07
问题 In my game I need to use the mouse to select units. However, I am encountering problems as I do not know how to get the coordinates of the click relative to the game, not to the window. For example, if Unit 1 is at the (0,0) point of the game, it could be at any point on the window depending on how I pan and zoom the window, but I want the mouse click to return (0,0) no matter how I move the window as long as I click on the same spot. Right now I am using: override func mouseDown(with event:

Mouse moved event within JPanel

不想你离开。 提交于 2019-12-12 10:48:16
问题 I'm having some issues with getting my mouse events to work. I have a JPanel inside of a JLayeredPane which is in a JScrollPane. Admittedly, I am fairly new to working with Swing, but essentially, I want the JPanel to react to the mouse moving, but have been unable to get it to work. public class CellHighlighter extends JPanel implements MouseMotionListener{ public CellHighlighter(){ } public void mouseMoved(MouseEvent evt){ System.out.println(evt.getPoint().x + ", " + evt.getPoint().y); }

How to close a web page on a button click, a hyperlink or a link button click? [closed]

浪尽此生 提交于 2019-12-12 10:43:58
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . How can we provide a hyperlink or button to close a web page ? 回答1: Assuming you're using WinForms, as it was the first thing I did when I was starting C# you need to create an event to close this form. Lets say

jQuery draggable : the draggable box go over the container - bug?

匆匆过客 提交于 2019-12-12 10:43:07
问题 Try this code : HTML <div class="draggable_container"> <div id="draggable_1" class="draggable"> <div class="exp"><!-- --></div> </div> </div> CSS html { height:3000px; } .draggable_container { height:300px; background-color:red; width:140px; } .draggable { height:60px; width:130px; cursor:pointer; border:5px solid #000000; background-color:#ffffff; } jQuery $(".draggable").draggable({ axis: "y", containment: 'parent' }); Now, if you click on the box "draggable" and you move the mouse up and

Pyautogui don't work in game window

只愿长相守 提交于 2019-12-12 09:42:41
问题 I'm making some tests using Pyautogui on games. But in those games that change your cursor and fullscreen games, none of the methods work. I'm trying now on Ragnarok Online. I tried: pyautogui.click() pyautogui.moveTo(x, y, time) pyautogui.moveRel(x, y) None of them works when inside the game window. They work fine outside. Is there a way to make it work? Or another library that I could use? By the way, win32api.SetCursorPos((x,y)) also doesn't work. Thanks. 回答1: The source code of Pyautogui

jQuery mouseover and mouseleave drop down menus

孤街醉人 提交于 2019-12-12 08:37:50
问题 The following displays a menu: <a href="#" id="cityclick">ONZE WAARDEN</a> <div id="citydrop"> <div class="dropbottom"> <div class="dropmid"> <ul> <li><a href="#">FAQ</a> </li> <li><a href="#">ITC</a> </li> <li><a href="#">CLUB</a> </li> <li><a href="#">CULTUUR</a> </li> <li><a href="#">ROBITICA</a> </li> </ul> </div> </div> </div> The jQuery for is as follows : $("#citydrop").hide(); $("#cityclick").mouseover(function () { $("#citydrop").slideDown('slow'); }); $("#citydrop").mouseleave

WPF - Detect mouse down for a set period of time

女生的网名这么多〃 提交于 2019-12-12 07:59:33
问题 what's the best way to detect when a mouse button has been held down on a particular element for a specific period of time? 回答1: You need to add MouseDown and MouseUp handlers to the object. In the MouseDown record DateTime.Now . If in the MouseUp handler: DateTime.Now.Subtract(clickTime).TotalSeconds > your_seconds_value then fire a new event MouseClickedForXseconds . If you don't want to wait for a mouse up event then you need to start a timer on the MouseDown method which fires your

Simulate a physical mouse move in Mac OS X

ぃ、小莉子 提交于 2019-12-12 07:52:12
问题 I'm looking for a way to simulate a mouse move event in Mac OS X 10.6. It would have to be defined in mouse units (rather than pixels — that is important!) I need this for an experiment which basically consists of drawing lines. Any ideas are welcome. Thank you! 回答1: One of the easiest ways to move the mouse in Mac OS X and other operating systems is to use a Java Robot. It can also simulate other events. For example, the mouse down or even a key press. However, it moves the pointer to a