Skip to main content

Posts

Showing posts with the label click

jQuery click off element event

I have a floating div that gets displayed, and I want it to be hidden when the user clicks off the div. This would be similar to the .hover() funtion callback when hovering off an element. Only I want to do this for click.

Dialog Click listener not triggering in IE8 or Firefox with jQuery

I have this click listener and for some reason it's not triggering in IE8 or Firefox: console.log("listener attached"); jQuery(".ui-button-text").click(function() { console.log("this should have triggered"); var ajaxUrl = '/ajax.php?popup=true'; var dataString = "param="+param+"&param2="+param2; // contruct the ajax request jQuery.ajax({ url: ajaxUrl, dataType: 'json', data: dataString, beforeSend: function() { jQuery(".ui-button-text").html("Saving..."); }, complete: function() { jQuery(".ui-dialog-content").dialog("close"); }, success:function(response){ } }); }); So I can see the "listener attached" in the console, but I don't see the click trigger, this works in

Eclipse: Android Soundboard buttons are "overclickable”

In my android soundboard, all of the buttons work perfectly and the sounds play normally, but there is a problem. The problem is that when you press a button in the app, you can press other buttons. For instance, if the button I press plays a siren like noise, I can press another button and both sounds will play at the same time. This is not what I want. Is there any code I can add to make it so that I can click only one button at a time, or some code that makes the previous sound stop and it will play the newly selected sound?

Running JQuery or Javascript on Facebook

I am trying to execute a simple bit of jQuery or JavaScript once logged in to my Facebook account. The end goal at this moment is to click on my custom feed once the element is visible, rather than having it default to the entire Facebook friend feed. On trying to code this using my Developer's Console in Chrome no JavaScript/jQuery seems to work at all. Even just a simple $('div'); returns null . Is it possible to run code on Facebook's page? What are they doing differently? I guess the end goal would be to click a div if the .val('give a waffle'); but just understanding why it has not worked until now would also be interesting. Any hints, tips or suggestions are more than welcome.

Open popupMenu only on mouse-click Swing

I have a question related with JPopupMenu that maybe someone can help me. As far as I can see, a JPopupMenu opens when you press a JMenu (is this is in a JMenuBar) or when you hover over a JMenu (if this is in a JPopupMenu). So, I have a JMenuBar containing a JMenu (let's call it 'File'). When I press 'File', a JPopupMenu open, which contains a JMenuItem and another JMenu (let's call it 'Properties'). Is there any way I can apply the same behaviour to the Properties JMenu as I have in the File JMenu: only opens the JPopup when the user click it and not hover over it? I know this is trying to avoid the normal behavior for the JMenu, but any of you have an idea if this is possible?

Multiple object selection with jQuery

I have a pretty basic jQuery question and forgive me if it has already been answered. Basically I attempt to have a link slide down a div. This is fairly simple however I require multiple links sliding down their respective divs. I understand I can just name the links and divs unique classes and solve the problem that way, however this naturally also requires a duplication of the jQuery code for each link-div and i have a lot. I therefore need a general script. A simplified version of my situation is as follows: HTML: <div> <a id=link1>toggle text 1</a> <div class=link1>TEXT 1</div> <a id=link2>toggle text 2</a> <div class=link2>TEXT 2</div> </div> My attempt at a jQuery general script for this: $(document).ready(function() { $('[id^=link]').bind('click', function() { var $div = $(this).attr('id'); if($('[class=' + div + ']').is(':visible