I had successfully implemented the pinterest pin it button on my site, but it has recently stopped working. Could anyone tell me why?
My website is http://www.lookbookcookbook.com and I am using the following code
<div class='w2bPinitButton' expr:id='"w2bPinit-" + data:post.id' style='display: none;visibility: hidden;height: 0;width:0;overflow: hidden;'>
<data:post.body/>
<script type='text/javascript'>
w2bPinItButton({
url:"<data:post.url/>",
thumb: "<data:post.thumbnailUrl/>",
id: "<data:post.id/>",
defaultThumb: "http://4.bp.blogspot.com/-YZe-IcKvGRA/T8op1FIjwYI/AAAAAAAABg4/j-38UjGnQ-Q/s1600/w2b-no-thumbnail.jpg",
pincount: "horizontal"
});
</script>
Looks like you have managed to sort out your issue?
If not this link may be helpful or to others that want to implement it in their Blogspot site.
http://www.way2blogging.org/2012/06/add-dynamic-pinterest-pin-it-button-for-blogger-blogspot.html
Related
I am creating a simple show/hide all toggle button for my images in my instagram feed. It works fine in the fiddle but when I put the same code on my server nothing works with no error. Can anyone help me troubleshoot why this isn't working.
Here is the HTML
<div class="btn btn-success toggleAll">
Show All/Hide All
</div>
Here is the Javascript
$('.toggleAll').on('click',function(){
$('.pp, .coat, .heart-wrap, .comment-wrap, .check-wrap, .grip .btn').slideToggle('fast');
});
and here is the jsfiddle that works
https://jsfiddle.net/galnova/ua0ojhhe/5/
Here is my site where it doesn't work
http://galnova.com
Any help is welcome guys.
Try
$(document).on('click', '.toggleAll', function(){
$('.pp, .coat, .heart-wrap, .comment-wrap, .check-wrap, .grip .btn').slideToggle('fast');
});
I don't see this code in your website's code:
$('.toggleAll').on('click',function(){
$('.pp, .coat, .heart-wrap, .comment-wrap, .check-wrap, .grip .btn').slideToggle('fast');
});
I ran this in the console and the show/hide button started working fine.
My website uses the SkyDrive Javascript API to show an 'Open from SkyDrive' button (using Wl.ui).
I noticed that the icon that used to be shown is no longer showing, I get a 404 - file not found on http://js.live.net/v5.0/images/SkyDrivePicker/SkyDriveIcon_blue.png
Has anyone seen the same issue and does anyone know how to solve it?
Some snippets:
The script
<script type="text/javascript" src="//js.live.net/v5.0/wl.js"></script>
The div for the button
<DIV ID="uploadFile_div">SkyDrive save button to appear here</DIV>
And the code for WL.ui
WL.ui({
name: "skydrivepicker",
element: "uploadFile_div",
mode: "open",
select: "single",
onselected: onPickFileCompleted,
onerror: onUploadFileError
});
The website that shows the problem is http://www.padvark.nl/index.php?page=gpxpauser
Thanks in advance,
Koen
This is actually an issue on the OneDrive side. We have a fix that should hopefully make it out soon.
This line of sample code from LinkedIn API works perfectly.
<script type="IN/Login" data-onAuth="loadData"></script>
but it runs automatically as the web page loads. I'd like to invoke this script using a button or link on a webpage. The idea being that the webpage loads and waits until the user is ready to authenticate.
Ideally I would like the LinkedIn Login image to appear, and wait, until clicked.
Thanks.
Based on your comment, it looks like you only want to display the SignIn plugin if the user has manually clicked a button/element on the page. Something like this, using jQuery, should work:
On your page, you have a button:
<div id="buttonControl">
<input type="button" id="showLinkedIn" value="Show LinkedIn" onclick="showLinkedIn();" />
</div>
<div id="buttonContent" style="display: none;"></div>
In a script block in the <head> of the page, you have the showLinkedIn() onclick function:
function showLinkedIn() {
// insert the SignIn plugin
$('#buttonContent').html('<script type="IN/Login" data-onauth="loadData"><\/script>');
// tell the LinkedIn JavaScript code to re-parse the element containing the SignIn plugin
IN.parse($('#buttonContent')[0]);
// hide button trigger, if needed
$('#buttonControl').hide();
// show the LinkedIn control
$('#buttonContent').show();
}
$('#buttonControl').click(function(){
$('#buttonContent').html('<script type="IN/Login" data-onauth="loadData"></script>');
$('#buttonControl,#buttonContent').toggle();
IN.User.authorize(loadData);
});
slightly different as the 'IN.parse($('#buttonContent')[0]);' does not seem to work...
tested 'IN.User.authorize(loadData)' and it works well! Got it from: http://developer.linkedin.com/documents/inauth-inevent-and-inui
You need to clear the cookies from the following method like
IN.User.logout(callbackFunction, callbackScope);
You need to call this function on that button from which you want to log out.
Example using jquery:
$('#demo') .click(function()
{
IN.User.logout(console.log("logged out..."));
});
I'm facing a problem with a slider that I'm using on a website.
(www.cloosedesign.com)
The website is a portfolio I made for a friend. So there are severals works to show.
Each work is listed as a link, and when you click on the link it shows you the corresponding picture with the slider. (I've put some PHP to get the right pictures from the database Mysql).
It works fine, except on SAFARI. Indeed sometimes when I click on a link the text of the footer (white text on the black box) desappear and re-appear, like if the page was refreshing.
This pb appear sometimes after the 3rd click, or sometimes after more clicks.
here is my code :
in the <head> :
I'm calling jquery :
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
And I'm calling the javascript file for the slider :
<script type="text/javascript" src="js/slides.min.jquery.js"></script>
then in the portfolio_english page I'm checking the images corresponding to the work selected (= $contenu):
<?
$images_sql = "SELECT * FROM `a_fichier`
WHERE id_fiche=".$contenu."
ORDER BY tri";
$images = mysql_query($images_sql);
echo'<div id="slides">';
echo '<div class="slides_container">';
while ($image=mysql_fetch_array($images))
{
echo "<img src='Images/PorteDoc2/".$image['nom']."' width='540' height='600' alt='".$image['titre']."' />";
}
echo '</div>';
echo '</div>'; ?>
And just after the php code I write the following javascript :
<script type="text/javascript">
$(document).ready(function() {
$('#slides').slides({
preload: true,
preloadImage:'Images/img/loading.gif',
pagination: true,
fadeSpeed: 0,
slideSpeed: 0,
effect: 'slide, slide',
});
});
</script>
And then I call the footer.php file.
Thanks
This http://jsfiddle.net/NNSqw/ is the code that does what I mean, it uses jquery and ajax, now, to explain the html bit is pretty straight forward the div with the id="content" will be where your content will get loaded into.
Now to the JS/JQuery, everytime a user presses a link the content of the div with the id="content" gets changed, you will have to make a page named get_images.php and make it use the php code $_GET['realisation']; to get the number of the link clicked and from there it will work like your current page :).
Sorry I'm not brilliant at explaining but, if you wish me to try and clarify it more just say :)
Edit:
Right in your portfolio_english.php file the following code should exists (I'm using the english version of your site):
<span class="link" onClick="javascript: show_image('1')">Entreprise internationale 1</span><br>
<span class="link" onClick="javascript: show_image('2')">Entreprise internationale 2</span><br>
<span class="link" onClick="javascript: show_image('3')">Entreprise internationale 3</span><br>
<span class="link" onClick="javascript: show_image('4')">Entreprise internationale 4</span>
You should have your links that the side, which have an onClick event leading them to the javascript function which should be in the head of the page:
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
show_image(no){
$.ajax({
url: 'get_images.php?realisation='+no,
success: function(data) {
$('#content').html(data);
}
});
}
</script>
[... rest of header ...]
</head>
Also in that file you should have the div where the images currently appear
<div id="content">
</div>
get_image.php
In your get_image.php you need to have what you currently use to get your images, so to get the number e.g. 41 into the php code you are using use:
<?php
$number = $_GET['realisation'];
[... Rest of php code to retrieve images ...]
?>
Also, if you still don't understand where I'm going try reading the jquery documentation to see if you understand it more then: http://api.jquery.com/jQuery.ajax/
OK, before any real investigation let's get a few things out of the way.
Update jQuery to the newest version (http://jquery.com/), then you don't need the easing plugin as it's built in nowadays.
Rather than bind to window.onload, use the proper syntax for using jQuery:
$(document).ready(function() {
$('#slides').slides({
preload: true,
preloadImage:'Images/img/loading.gif',
pagination: true,
fadeSpeed: 0,
slideSpeed: 0,
effect: 'slide, slide',
});
});
If that isn't any good, make a really small test page that only has the code you are using with the slider, and check if it's still a problem.
To be honest, I don't really know why people use these massive slider plugins, making a slider is an easy little job that requires less than 10 lines of jQuery.
I am using the XFBML version of the Like button because I need the Send button.
Here is the code I use:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=178223665570391345&xfbml=1"></script>
<fb:like href="<?php echo current_url(); ?>" send="true" layout="button_count" width="150" show_faces="false" font="trebuchet ms"></fb:like>
I use so that it will Like the page it shows up on.
The Send button works fine but the Like button does't work. I've tried liking it a few times, I get this in the JS response:
for (;;);{"__ar":1,"payload":{"requires_login":false,"success":false,"already_connected":false,"is_admin":false,"show_error":false,"error_info":null}}
You can see the page here: http://www.salemarked.com/share/152/
The Send button doesn't work either and here is the error it gives me - http://d.pr/VPO1
Thanks for your help!
I got it to work now. Removed current_url() since by default, href is going to be the current page if left blank.