I've hit a problem I can seem to find a way around.
Essentially, I have a button with the "addthis_button" class, hovering over the button displays the AddThis box. Works perfectly :)
However I need to turn this on and off based on the users other actions around the page, is it possible to turn the AddThis hover event on and off as and when I need to?
For example, I have a button that says "Share" at the top of my page. Rolling over it displays AddThis. I then go and click a few things on the page. The share button has greyed out nicely but when I roll over it I still get AddThis.
I've tried re initializing AddThis completely but to no avail.
Thank you for any help you can give.
Edit: jsFiddle link hjsfiddle.net/49Pgf/
I think this should work to disable AddThis from showing the menu on hover:
addthis.button('.addthis_button', {ui_click:true}, {});
This requires an actual click on your link to show the menu. And then of course, you can re-enable it by calling the opposite:
addthis.button('.addthis_button', {ui_click:false}, {});
Hope this works for you.
Related
The search icon on my mobile website suddenly stopped working recently. It's supposed to toggle open a search bar; however, now when I click it, nothing happens.
When I long press via Chrome on mobile it displays "about:blank#blocked" and on Firefox on hover it displays javascript:void(0).
Not sure what caused it to stop working and it's a bit frustrating.
If anyone has any insights or ideas on how to solve it, that would be super helpful.
My website is www.gentlemanwithin.com
I see your issue:-
Your issue is when you are trying to access custom search form that unable to access because you added an extra search button which is not belongs to that. So you try toggle function to show yellow colored area of your code. After it your issue will solve. Below I have attached your site screenshot image, that you can see it for the reference.
I have to make a website for school and we have to make a drop-down-menu. I've made one and it works fine, but on my other pages the drop-down-menu won't open when I click on it.
Can somebody help me?
I'd recommend that you use the chrome developer tools to check and see what happens to the other pages when you click the button that's supposed to initiate the dropdown menu.
If nothing happens, right click the button and hit inspect in developer tools to verify that you're targeting the correct element, and to verify that the dropdown menu actually exists on all your pages.
Most likely you haven't linked the javascript file on the other pages. Can't say much without you showing what you've done first.
I read many posts but my problem is not really solved. I hope you can help me.
Problem:
In my C# Application I use a webcontrol and navigate through a website. This works good except for buttons. I want to click them, but it does not work 100%:
webBrowser1.Document.All["dnn_ctr423_View_img_filter"].InvokeMember("click");
or
webBrowser1.Document.GetElementById("dnn_ctr423_View_img_filter").InvokeMember("click");
The button seems to be clicked but the mask which pops by the button is instantly closing after my code. (it looks like the button is clicked instantly a second time to close it)
So I readed many and make try and error. Here is some code which made the click and the mask dont close after click. But the code seems to pause because after this clicks nothing happens:
webBrowser1.Document.GetElementById("dnn_ctr423_View_img_filter").InvokeMember("click");
webBrowser1.Document.GetElementById("dnn_ctr423_View_img_filter").RaiseEvent("click");
Maybe the mask dont closes because the program pauses.
Anyone who understand this behaviour?
If I hover the button I get - javascript:void(0); (Firefox)
I really thanks anyone for help
I am trying to make a page COMPLETELY UNCLICKABLE (both right click and left click) and to display a message when someone clicks. Since I know that this will raise lots of questions such as
"why would anyone ever want to do this...this is stupid...then nobody
can navigate the site...and it doesn't protect your content
anyway...etc"
here is the explanation of my purpose. I have a page that is at the moment only a graphic mockup of what the finished website will eventually look like. No matter how many times I explain that the mockup is ONLY AN IMAGE and not a real navigable website, they still email me to say that they cannot click on the menus and links. Since it is a single page mockup, I want to pop up an alert() message (can't use a modal because you can't click to dismiss it if clicking is disabled) to let them know that they have clicked something non-functional. I am trying to do this in as few lines of code as possible, and have the following working at the moment:
<script>
$('html').mousedown(function(event) {
event.preventDefault();//To prevent following the link
alert('Demo Graphic Only...clicking on stuff will NOT work at this point.');
});
</script>
The issue is that when using .mousedown I capture the user trying to click on the browser scroll-bar to scroll down. I was surprised by this since it is not part of the actual PAGE CONTENT but rather a part of the BROWSER...but it is catching it nonetheless. I tried using .click in place of .mousedown however only seem to catch a normal (left) click in that case... Does anyone know how to easily (minimal lines of code if possible) capture the left AND right click event, but allow user interaction with the browser scrollbar?
Try this :
$(document).click(function(event) {
event.preventDefault();//To prevent following the link
console.log('Demo Graphic Only...clicking on stuff will NOT work at this point.');
});
This Function will be called when click is made on the page , not on the Scrollbars
Try to use
event.stopPropagation();
or
event.stopImmediatePropagation()
For people who come across this question, an alternative approach, good especially if you need to prevent mousedown specifically:
Put the scrolling content in a wrapper element and prevent mousedown only on the inner element. Set the wrapper element to overflow: auto; height: 100%;
I am making use of the Lavalamp plugin from http://nixboxdesigns.com/projects/jquery-lavalamp/ and everything seems to be working fine except that there is a little quirk when using the back button.
For example:
If you are starting off from the home page, the hover is underneath the home menu.
Click on a new menu item, the hover appears underneath it
Click on the browser's back button, and the hover does not return to the home menu item, it stays at the previously clicked one.
I need to find a way to call the Lavalamp function when the back button is being triggered.
Hope to get some help here
It sounds like the OnBeforeUnload event is what you are looking for.