Disable html tooltip on d3 bubble chart? - html

If you look at this example: http://bl.ocks.org/mbostock/4063269
When you mouseover the circle text, there is an html tooltip that pops up. Is there any way to disable this?
I thought using css would resolve the issue:
body {
font-family: Trebuchet, sans-serif;
color: black;
font-size: 14px;
font-weight: normal;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
but no luck.

The tooltip is shown by the browser based on the title attribute. If you remove the line of JavaScript that adds this, the tooltip will no longer appear.

Related

How to make div and img unselectable [duplicate]

This question already has answers here:
How to disable text selection highlighting
(45 answers)
Closed 1 year ago.
I can't make that code unselectable. How can I change it?
I tried placing user-select: none in all of css classes, but it's still selectable.
<div class="outer">
<a href="/">
<img src="/wp-content/themes/theme/assets/img/logo.png">
</a>
</div>
user-select is not supported in all browsers without prefix. Try this:
.outer {
user-select: none;
-webkit-user-select: none; /* Safari 3.1+ */
-moz-user-select: none; /* Firefox 2+ */
-ms-user-select: none; /* IE 10+ */
}
This was answered here, I can't post it in chat yet, sorry: How to make HTML Text unselectable
Long story short:
.outer {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

Linking a hyperlink to a google form in a button

I would like to be able to access my google form by simply pressing a button.
I have drawn a button and the hyperlink I would like to link it to is - https://docs.google.com/forms/d/e/1FAIpQLSdupUHV2uO6q69BHXvPzE1DgJu32HYQ31zPdyZ5uflmOftXRw/viewform","https://docs.google.com/forms/d/e/1FAIpQLSdupUHV2uO6q69BHXvPzE1DgJu32HYQ31zPdyZ5uflmOftXRw/viewform
Any help writing this code would be brilliant
Thank you
<form action="link-to-google-form" method="POST">
<input type="submit" value="Go" style="width:65%;height:40;" />
</form>
Change the width/height/other style options to your liking.
easily you can use (a) tag in css :
<a href="https://docs.google.com/forms/d/e/1FAIpQLSdupUHV2uO6q69BHXvPzE1DgJu32HYQ31zPdyZ5uflmOftXRw/viewform" >
Text to show in your link
</a>
and if you want your link seems like buttons you can use this code with styles:
<a style="display: inline-block; padding: 6px 12px; margin-bottom: 0; font-size: 14px; font-weight: 400; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-radius: 4px;color: #333;background-color: #fff;border-color: #ccc;" href="https://docs.google.com/forms/d/e/1FAIpQLSdupUHV2uO6q69BHXvPzE1DgJu32HYQ31zPdyZ5uflmOftXRw/viewform" >
Text to show in your link
</a>
Its better to copy <a> style content in to your css file.
If you want change color of button just change background-color and color in <a> style.

Stop user-selection in Bootstrap navbar

I would like to prevent user-selection to be possible on a Boostrap navbar, such as :
http://getbootstrap.com/examples/navbar-fixed-top/
How to stop user-selection ?
I tried user-select: none; but it fails if you do CTRL-A.
Note : I don't want to stop user to copy text on the page, but I want to provide better user experience by avoiding selection of navbar elements.
In bootstrap 4.5 and above, you can just use class="user-select-none"
You could do it like this:
Bootply - DEMO
.navbar {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
More Info:
Mozilla MDN user-select
CSS-Tricks user-select
Solution 2: Disable user selection when press CTRL+A
You could also do it by set the ::selection background color to none
Bootply - DEMO
div.navbar *::-moz-selection {
background: none !important;
}
div.navbar *::selection {
background: none !important;
}
.navbar {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}

How can I prevent these 'selected' artifacts on HTML elements?

Sometimes clicking isn't perfect, the mouse might move slightly and the button/elements end up with little 'selected' artifacts around them as seen here:
Of course clicking somewhere gets rid of it, but it's kind of annoying and looks crappy. Is there any way I can disable this so that the app seems more solid?
HTML/CSS:
<td id="controls">
<span id="ccw" class="menuitem"></span>
<span id="cw" class="menuitem"></span>
<span id="zin" class="menuitem"></span>
<span id="zout" class="menuitem"></span>
</td>
#cw{
background-image:url('icons/rotatecw.png');
}
#ccw{
background-image:url('icons/rotateccw.png');
}
#zin{
background-image:url('icons/zoom_in.png');
margin-top: 2px;
}
#zout{
background-image:url('icons/zoom_out.png');
margin-top: 2px;
}
.menuitem{
background-repeat:no-repeat;
width: 32px;
height: 16px;
display: inline-block;
}
In many browsers (except Opera and IE before IE10), you can use user-select with its various browser-prefixes. See MDN docu for details.
.controls {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}

Preventing images and text to be selected

I have an image being hacked in as a background image (as shown here). I've noticed that if I drag my mouse over it though, it selected the image so that it can't be deselected. I've tried the following code to no avail:
<style type="text/css">
html, body {
height: 100%;
margin: 0;
padding: 0;
}
img#bg {
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
}
#content {
position:relative;
z-index:1;
top:0px;
left:0px;
}
*.unselectable {
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
user-select: none;
}
</style>
Any ideas?
Add this to your style sheet
.selectDisable {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
}
.selectEnable {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-o-user-select: text;
user-select: text;
}
Just add the class selectDisable to the element you want to prevent from being selected.
The drag effect occurs on webkit(chrome, safari, opera). It does not happen on Firefox.
Don't this apply to your whole document if you have textual content because then you won't be able to select text, which is not very user-friendly.
You could also prevent dragging by adding another empty div on top of your image with the same selectDisable class.
Here is a working example:
http://jsfiddle.net/xugy6shd/3/
draggable="false" worked for me
If you load image as div's background you can't select it.
EDIT
<div style="background-image: url(../images/test-background.gif); height: 200px; width: 400px; border: 1px solid black;"> </div>
If you are using jQuery I've written a tiny jQuery plugin - wrapper that does pretty much what ppumkin wrote:
(plugin is in js part along with an example usage) http://jsfiddle.net/gryzzly/HtvB8/