Home  >  Article  >  Web Front-end  >  js add to favorites and use Jquery to change transparency_javascript skills

js add to favorites and use Jquery to change transparency_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:02:131171browse
Copy code The code is as follows:

/*Add to favorites JS*/
$("# addfavorite").click(function () {
addfavorites();
});
function addfavorites() {
var sURL = document.URL;
var sTitle = document.title ;
try {
window.external.addFavorite(sURL, sTitle);
}
catch (e) {
try {
window.sidebar.addPanel(sTitle, sURL, "");
}
catch (e) {
alert("Failed to add to favorites, please use Ctrl D to add");
}
}

}

//Change transparency

$("#OneImg").css('opacity', '0.6');
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn