
MY BOOKMARKLET
This week's task is to write my own bookmarklet. I want to try to make a spoof bookmarklet. I am a fan of the Korean group blackpink, so I plan to make people click the bookmark, the source website will become a fan website, and the hyperlinks on the website will also become random links about the group.
​
Here are my Js code:
​
$("p").mouseenter(function(){
var link=['//www.facebook.com/BLACKPINKOFFICIAL/','//www.youtube.com/channel/UCOmHUn--16B90oW2L6FRR3A',
'//time.com/collection/time-100-next-2019/5718842/blackpink/',
'//www.google.com/search?q=blackpink&rlz=1C5CHFA_enUS887US887&tbm=isch&source=lnms&sa=X&ved=0ahUKEwjUnqbt0sLnAhUu1VkKHUiYCpQQ_AUIDCgD&biw=1281&bih=882&dpr=2','//www.billboard.com/music/blackpink',
'//footwearnews.com/2019/fashion/celebrity-style/blackpink-best-fashion-style-1202892967/']
var index=Math.floor((Math.random()*link.length));
$("h1").text("BlackPink Fan Club")
$("h1").css("background-color","pink")
$("body").css("background-color","black")
$("p").css("background-color","pink");
$("a").text('love BlackPink !!!');
$("a").css("color","pink");
$("a").css("font-size","200%");
$("a").attr("href",link[index]);
});
$("p").mouseleave(function(){
$("p").css("background-color","black");
$("p").css("color","black");
$("p").css("color","pink");
$("p").text('BlackPink, Can U hear Ya?')
$("a").attr("href",link[index]);
});
(function(){
var m;
m = $("<div style='position: absolute;' id='movePic'><img src='https://www.freepnglogos.com/uploads/blackpink-logo/blackpink-transparent-logo-blackpink-fdpink-sticker-0.png' height='80px' width='120px'>");
$("body").after(m);
$("body").mousemove(function (e) {
m.css("left", e.pageX + 5);
m.css("top", e.pageY + 5);
});
$("body").hover(function () {
m.show();
}, function () {
m.hide();
});
})()
​
​