Code to add to display a Label in one adsense ad - label

Thanks for reading! Probably a very dumb question.. But i've searched here and haven not found an answer.. So if anyone could please help me..
I work with adsense on my wix blog. Only thing i needed was to display ADVERTISEMENTS written on the top of the ad. I don't know what to add in the adsense code to make it appear. Only whing i could do was make the ad display aligned center. This is how one code looks!
<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6224129687174030"
crossorigin="anonymous"></script>
<!-- MobileTopDesktop&Post / Desktop&MobileMiddle of Post (300x250) -->
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-6224129687174030"
data-ad-slot="4506401193"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
I don't know whether i could put advertisement on top of the ad and maybe something to distinguise the whole ad like a background.
I'm here to learn. Thanks a million!
PS.: the backgroud of the website is BLACK

Related

Make entire div clickable

I am trying to get the whole div clickable and this works but only with a straight link to another site. Is there a way to make it work with this text in it also:
<div class='reddit' title='Share Us On Reddit' onclick="window.open('http://www.reddit.com/submit?url=httpsFwww.example.com&title=XXX is Cape Breton's Homepage. Start Your Web Search With Beautiful Cape Breton Island')">
Thanks
From CSS Tricks
This probably isn't a thing you need to rely on JavaScript for
anymore. Since HTML5, this is perfectly valid:
<a href="http://example.com">
<div>
anything
</div>
</a>
And remember you can make links display: block; so sometimes you
don't even need the div.
<div style="cursor:pointer" onclick="document.location='evenidontknow-page.html'">
<h2>Full Div Clickable</h2>
</div
The above code helped me very well, and this will not require any extra code.
Using a tag may solve the problem but we need to add extra code to it.
please check this link for more info w3schools
Bootstrap has a feature called "Stretched Link". From the documentation:
Make any HTML element or Bootstrap component clickable by “stretching” a nested link via CSS.
You can read more by visiting the following link:
https://getbootstrap.com/docs/4.4/utilities/stretched-link/

Joomla : How to stop showing related videos in jv_youtube at the end of video

I am using youtube video in joomla where the code is like this :-
[jv_youtube url="https://www.youtube.com/watch?v=8Di0IOQssOM&rel=0" width="600" height="540" responsive="yes" autoplay="no" rel="0"][/jv_youtube]
What I want is to stop showing related other videos come at the end of video. I want to replay the video or just stop.
I know how we can stop this - by putting ?rel=0 but you can see I have already put &rel=0 and also rel="0" but still the issue persists.
Any idea? Anyone? How to do this in Joomla?
Thanks.
Sorry but could not find any clean solution for this but still somehow I managed to get it working as the way I wanted (rel=0)
I put this script :)
<script type="text/javascript">
jQuery(document).ready(function() {
var ifrm = jQuery(".jv-youtube iframe");
ifrm.attr("src", ifrm.attr("src")+"?rel=0");
});
</script>
This class - jv-youtube will always be there before iframe in case of joomla.
Thanks.

Show gif animation while LinkedIn member profile is loading

I wanted to show an animated gif while the LinkedIn Member Profile Plugin is being loaded.
Here is the original code:
<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/MemberProfile" data-id="http://www.linkedin.com/in/reidhoffman"
data-format="inline"></script>
I found a similar question here but I'm not sure how I can apply that to the LinkedIn script.
Any solutions would be appreciated :)
I managed to figure something using related examples but the gif gets removed few seconds before the script is actually displayed.
I placed the linkedin plugin codes in linkedin.js and tried both below methods:
1:
$('#linkedin').html('<img src="ajax-loader.gif" />').load("linkedin.js");
2:
$('#linkedin').append('<img id="animation" src="ajax-loader.gif" />')
.load("linkedin.js")
.complete(function(data) { $('#animation').remove(); });
HTML
<div id="linkedin"></div>
I suppose the gif is removed once the script is loaded and yet to be executed? I also tried using getScript() couldn't get any results.

Google +1 HTML validation failed to W3C standards

I am using Google +1 on my games website. It's very difficult for me to validate the page. I tried near about every solutions on stackoverflow but always disappointed :-(
Please help me to solve the problem.
Here is the code I'm using,
<div class="gbutton" ><g:plusone size="medium"></g:plusone></div>
Thank you!
For w3c validation please use the code like,
<script language="javascript" type="text/javascript">
//<![CDATA[
document.write('<g:plusone size="medium" href=""></g:plusone>');
//]]>
</script>
Apparently this guy has an answer:
http://jamesingham.me/blog/google-plusone-w3c-valid
Even though it's not strictly "valid."
Well, I found a solution which validates the page successfully.
<div class="g-plusone"></div>
But drawback is we can't use size="medium".

FB + Twitter share buttons + FB Like button === huge performance issues

My brand new job is full of wonderful and awful surprises. one of the most interesting part of this job is the will to enhance, accelerate, make everything scale.
And today, first real problem.
Here's the deal : we get up to 20 list elements, each one of them displaying its own Facebook share, Twitter share, and Facebook Like button.
As you can imagine, 60 iframes opening is just a pain for user experience.
My question : anybody has already been facing such problems, and what would you recommend to upscale these performance issues ?
While I'm thinking of an AddThis implementation, I hope there are other solutions I could consider.
Best way to improve performance is not to copy paste the code from facebook plugins.
Facebook 'Like Button' code looks like:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=127702313984818&xfbml=1"></script>
<fb:like href="example.com" send="true" width="450" show_faces="true" font=""></fb:like>
Issue with this is, if you have 20 like buttons, then 20 Divs are created with id="fb-root" and 20 times the script for all.js is called. Best way is to move the
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=127702313984818&xfbml=1"></script>
to header of page and whenever you want a like button, only use
<fb:like href="example.com" send="true" width="450" show_faces="true" font=""></fb:like>
Same goes for facebook comments & other plugins.
Also, foir some plugins facebook provides option to either use xfmbl or iframe code. Always pick the iframe code because facebook's js has to parse all xfbml code and convert to iframe. It causes a lot of DOM insertions and slows down the page.
Hope this helps!

Resources