I have a button inside a jquery mobile popup div. I will like to set a onclick javascript function to let the popup div close without using the id of the div once the button clicked. Any solution?
Can call parent too:
$(this).parent(".ui-popup").popup("close");
Related
I have div with a button inside it. I want when a user clicks on the div (outside the button's rect) to initiate the button click with its animation. Is there any simple css solution, without javascript?
Is there a way to fire the onclick event in a div tag without css: position absolute?
<div onclick="fireevent();">
SOME TEXT or IMG
</div>
function fireevent(){
alert("fired");
}
This does only work if I add some css with position:absolute. Any other way? Because I can't put the div to a special position.
You can use jquery http://jsfiddle.net/gbce1u55/
$('div').click(function(){
alert("fired");
});
Set the div to a minimum height and width so that an event is triggered on clicking within the set size.
A better suggestion is to fire events on clicking specific tag elements (like text or images) rather than clicking the div itself.
Finally I found the problem:
I changed the innerHTML by the event: mouseover / mouseout. This killed my click event.
Now I add an createElement(div) over my master-div with the changing text and the underlaying master-div fires the onclick.
I have a Panel that I'm using as a modal dialog box, and as such the contents should be hidden from view while the page is loading. However, if I use CSS to set the div's display:none or visibility:hidden then the YUI show() & hide() methods don't work properly (eg, clicking the button to call up the modal dialog greys out the screen, but the referenced div does not appear). Can anyone point me towards the best way to do this?
Thanks!
Try adding yui3-widget-loading to the container div. When Y.Panel is instantiated, it will remove this class. You can then define .yui3-widget-loading { display:none; } so it is not visible during page load.
I created a pop up dialog when I click on an image :
http://fewste.ps/blueimp-jQuery-Image-Gallery/
but how can I add tabs to the pop up window ???
Put your tabs inside a div then use a modal plugin which supports inline , and call for that div
I have a web user control with a modal popup extender in it. the modal popup contains an asp:Panel control in it. This panel contains other controls.
I'd like to make the modal popup scroll as the user scrolls the page. (position:absolute)
Tried to set X and Y properties of the popup extender. it changes the X and Y properties of the popup. But still: position:fixed
Tried to set the Panel's CssClass to (.ModalWindow) which has the following defiition: .ModalWindow{position:absolute;} But the position:fixed overrides it.
Tried to wrap the asp:Panel in a div: <div style="position:absolute;"> But still no luck.
Have you tried the following:
.ModalWindow {position: absolute!important;}
The !important override is a really handy trick, particularly when working with ASP.NET controls.
Here's a bit more about it:
http://www.electrictoolbox.com/using-important-css/