Reputation: 455
I have a button on navigation bar which when clicked, displays a dialog box.I want to keep this button invisible and whenever anyone clicks at the place where the button is placed it should open a dialog box i.e. it should remain fully functional even if it is invisible.I have tried visibility:hidden
and display:none
but nothing seems to provide me the desired result.Here is the fiddle -
https://jsfiddle.net/payalsuthar/58bw712t/5/
I want to hide the button in this fiddle and if i click at the place where the button is placed it should display the dialog box.
Thanks in advance.
Upvotes: 1
Views: 1140
Reputation: 433
Try this..
#clickMe{
background-color: transparent;
color: transparent;
border: none;
}
Upvotes: 0
Reputation: 247
You can use opacity 0 for hidden the button. And it is clickable.
This may help you. Working example is below.
`https://jsfiddle.net/manishghec/upvsftyq/2/`
Let me know if this works for you.
Upvotes: -2
Reputation: 8960
Then instead of button
use div
and have onclick event defined for that div.
Since div
will have no content, it will be like invisible and still be clickable.
<div id="clickMe" style="width:50px;height:50px"></div>
Upvotes: 0
Reputation: 1297
You can try below code:
#clickMe{
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
/* IE 5-7 */
filter: alpha(opacity=0);
/* Netscape */
-moz-opacity: 0;
/* Safari 1.x */
-khtml-opacity: 0;
/* Good browsers */
opacity: 0;
}
Upvotes: 0
Reputation: 121
How about this?
https://jsfiddle.net/58bw712t/12/
make the appearance
none
#clickMe{
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border: none;
background: none;
width : 100px;
height: 100px;
}
Upvotes: 0
Reputation: 11502
Create a blank label instead of button and you can achieve it like follows:
https://jsfiddle.net/58bw712t/10/
<lable id="clickMe"> </lable>
$('#clickMe').click(function() {
$('#dialog1').dialog({
buttons: {
"yes": function() {
$(this).dialog('close');
},
"no": function() {
$(this).dialog('close');
}
}
});
});
Upvotes: 0