Bootstrap 3 - How to change the hyperlink title text showing as tooltip using javascript/jquery?
Tags: javascript,jquery,html,css,twitter-bootstrap
Problem :
I am trying to change the hyperlink title using javascript/jquery when the link is clicked. HTML
<a
href="javascript:addRss('234');"
class="btn btn-success"
title="Add content to Personal RSS"
id="addRssbtn"
data-toggle="tooltip" >
<i class="fa fa-rss fa-lg"></i>
</a>
CSS
@import url("http://netdna.bootstrapcdn.com/bootswatch/3.1.1/cerulean/bootstrap.min.css");
@import url("http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css");
@import url("http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css");
JAVASCRIPT
$(function (){$('[data-toggle="tooltip"]').tooltip({});});
function addRss(hash){
$("#addRssbtn").attr("class", "btn btn-success active");
$("#addRssbtn").attr("title", "Remove content from Personal RSS");
$("#addRssbtn").attr("href", "javascript:unaddRss(" + hash + ");");
//some other post data stuff
};
the title gets changed and shows too, only if i am not using
data-toggle="tooltip"
so how can i make the data-toggle="tooltip" to show the new changed title as a tooltip when the link is clicked ?
above code is working except the new tooltip on my pc but not on jsfiddle.
Solution :
Update the tooltip using the fixTitle
option.
$("#addRssbtn").attr("title", "Remove content from Personal RSS")
Becomes
$("#addRssbtn").attr("title", "Remove content from Personal RSS").tooltip('fixTitle');
You can add .tooltip('show');
to show the tooltip straight after:
$("#addRssbtn").attr("title", "Remove content from Personal RSS").tooltip('fixTitle').tooltip('show');
CSS Howto..
You can use http://lesscss.org/ or http://sass-lang.com/ . The CSS way would be: #block:hover #left, #block:hover #right { fill: color1; } and with less: #block:hover { #left, #right { fill: color1;...
Try like: http://jsbin.com/qalir/1/edit ul{ padding:0; list-style:none; border-left:1px solid #444; } ul li{ padding-left:15px; position:relative; /* to allow :before pseudo element be absolute */ } ul li:before{ content:" "; height:1px; width:15px;...
My issue is caused by using the css code below. QWidget { background-image: url(:/texture.png); } By defining a default texture all background colour you set becomes hidden behind this texture....
Using a background image A background image is a better choice semantically here as the image is mainly decoration. The button containing the image is given a class, .imageLink, and...
Declare a variable assigned to your interval function var slideshowInterval = setInterval(function() { $('#slideshow > div:first') .fadeOut(2000) .next() .fadeIn(2000) .end() .appendTo('#slideshow'); }, 3000); So when you want to stop it,...
Okay so it turns out trying to do it with File.getPath() or File.getAbsolutePath() was the issue. Turns out to make it work in code you need to use File.toURI().toURL(). So...
To get an element using CSS you can try this: diver.findElement(By.cssSelector("button.btn.btn-primary.btn-block.btn_wave")); This combines all classes from your button, BUT you can use just one of them and it might already...
Codepen example: http://codepen.io/anon/pen/fipaL Instead of top and left properties you shoud use translate3d CSS3 property, so to get full benefit of GPU acceleration. For the image scaling you can...
CSS: .part1 { background: url(bkgd.jpg) no-repeat center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; width: 100%; } JS: using jquery $(window).resize(function () { $(".part1").css("min-height", $(window).height()); }); $(document).ready(function ()...
Use the property object-fit: cover. See this for an example.
Here a little code that will do what you want : $('div:not(:first)').each(function(){ var numEl = $(this).parentsUntil('div:first', 'ul').length - 1; $(this).css('padding-left', numEl * 20 +'px') }) It count the number of...
Look at the documentation page for ngStyle. This is how you can use it: HTML <p ng-style="myStyle">Text</p> <button ng-click="set()">set</button> <button ng-click="clear()">clear</button> Controller $scope.data = {"PHcolour":"rgb(4, 31, 156)","Ctextcolour":"rgb(59, 214, 252)"}; $scope.set...
According to your HTML code. a tag has active class. So then it should be .navbar-default .navbar-nav>a.active, instead of .navbar-default .navbar-nav>.active>a. Important Note whereas, bootstrap states that active class should...
Maybe: $(document).ready(function(){ $('.menuItem').each(function(i){ $(this).css("background-image", "url(../PictureLibrary/NavBarShortcuts/"+this.id+".gif)"); }); $('.menuItem').click(function(){ $(this).siblings().filter(".active") .removeClass("active") .each(function(i){ $(this).css("background-image",...
Just create a rectangle and skew the Y axis using the CSS3 transform property. In this case, transform: skewY(-20deg) will work. .shape { border: 2px solid; height: 200px; width: 100px;...
try this jsbin: http://jsbin.com/arisuy/5/edit Relevant CSS p { width: 50px; text-align: center; position : relative; } p:before { position: absolute; content : ""; left : 50%; top : 0; height:...
Hi each word is rotated every 3 seconds, you need to add css for the last span you have added with delay of plus 3 seconds in this case 18s...
I had to get rid of the margin around the blocks, because percentage widths are difficult to cleanly apply to elements with margins, but you can see the changes at...
Since the targeted element, .video-preloader is absolutely positioned, it's important that the parent element, .video is relatively positioned. .video { /* .. */ margin:0 auto; position:relative; } In order to...
For the height of a div to be responsive, it must be inside a parent element with a defined height to derive it's relative height from. If you set the...
You can do this by adding a class to the 3rd <div class="span8"> like this: <div class="span8"> ... </div> <div class="span8"> ... </div> <div class="span8 boldClass"> ... </div> and you...
If you were styling a link you would use :active or :focus but as you're using this on a dom element, you would have to use jQuery to add a...
HTML5 actually contains an entire section dedicated to case-sensitivity for the purposes of selector matching. Here's what it says about attribute names and values: Attribute and element names of HTML...
You need to wrap it inside a div with float:left; and set the dropdown div to float: right; and buttons div to float: left; - here is fiddle (I have...
Using your HTML, you can do something like this: CSS ul{ list-style:none; } li{ float:left; width:100px; height:50px; background:black; border:2px solid gray; text-align:center; } a{ color:white; text-decoration:none; font-size:24px; font-weight:bold; line-height:50px; font-style:italic...
The information you want to be in the modal window, you need to put in a seperate location. What you are doing by saying $(".previouslink").modal(); Is that you want all...
I would wrap the input tag in a 'div' tag: HTML <div class="inputCont"> <input id="second" value="I am a bit messed up!" /> <i class="fa fa-calendar second"></i> </div> CSS .inputCont {...
Is this what you want to accomplish: body { width: 100%; height: 100%; margin: 0; } .wrapper { position: absolute; height: 100%; width: 100%; background: url(https://pixabay.com/static/uploads/photo/2016/01/11/22/05/background-1134468_960_720.jpg) top left no-repeat; background-size:...
#sf-slider-overlay { position: absolute; top: 230 px; z - index: 999; width: 1170 px; margin - left: auto; margin - right: auto; } you only have to do this.. Position...
The brand is "centered" because it is inside a container div and this container div is always centered with varying width based on the width of your view-port or browser...