Foros del Web » Estrategias Digitales y Negocios Online » Social Media Marketing »

Opción de Pin It en cada imagen

Estas en el tema de Opción de Pin It en cada imagen en el foro de Social Media Marketing en Foros del Web. Buenos días. Estoy tratando de añadir la opción de "pin it" a cada imagen de mi web a través de este código: <script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script> ...
  #1 (permalink)  
Antiguo 29/01/2013, 03:53
 
Fecha de Ingreso: septiembre-2008
Ubicación: Sevilla, España
Mensajes: 124
Antigüedad: 15 años, 7 meses
Puntos: 0
Opción de Pin It en cada imagen

Buenos días.

Estoy tratando de añadir la opción de "pin it" a cada imagen de mi web a través de este código:

<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script>
<style type='text/css'>
.pinned .pin {
opacity: .7;
position: absolute;
margin-left: -45px;
}
.pinned .pin:hover {
opacity: 1;
}
</style>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
// surround each image with div class='pinned'
$('img').each(function() {
if ( ($(this).height() > 105) && ($(this).width() > 205) ) {
$(this).wrap("<div class='pinned' />");
}
});
// grab each image div with class of .pinned
var each_image = $('div.pinned');
// iterate through all divs
each_image.each(function() {
var pinned_height = $(this).find('img').height();
if ($(this).find('img').hasClass("imageLeft") == 'true') {
$(this).addClass('imageLeft');
}
if ($(this).find('img').hasClass("imageRight") == 'true') {
$(this).addClass('floatRight');
}
//if (pinned_width > 205 && pinned_height > 105) {
// dynamically add span and empty pin button
$(this).append('<span class="pin"><a href="" target="_top" class="pin-it-button" count-layout="vertical" title="Pin it On Pinterest"><img src="http://1.bp.blogspot.com/-d-a06QQgOI0/T60PXEVtr6I/AAAAAAAAFNA/C8Csz68aAX8/s1600/pinterest.png" /></a></span>' );
$(this).find('.pin').css('marginRight', '2px');
$(this).find('.pin').css('marginTop', pinned_height - 22);
// cache variables
var $this = $(this),
// cache this
image_source = $this.find('img').attr('src'),
// grab image src
web_title = $(location).attr('href'),
image_height = $this.find('.pinned').height(),
// grab current page title
description = $this.find('img').attr('alt'),
// grab img alt text
slug = $this.find('a.pin-it-button');
// find the Pinterest link
// modify Pinterest href with new image details
if (image_source.indexOf(".com") == -1) {
image_source = window.location.protocol + "//" + window.location.host + image_source;
}
slug.attr('href', 'http://pinterest.com/pin/create/button/?url=' + web_title + '&media=' + image_source + '&description=' + description + '');
//};
});

});//]]>

</script>

El problema que me encuentro es que deseo que la ventana de Pinterest para hacer Pin It se me abra en un pop up, y no en otra pestaña o en la misma ventana.

Esto es lo que he conseguido yo: http://speakerphone.99k.org/pin.html
Y esto lo que me gustaría conseguir: http://ruevintage74.com/blog/?p=7591 (pasad el ratón por la imagen y veréis el botón de Pin It)

¿Alguien sabría como hacerlo? gracias de antemano (:
  #2 (permalink)  
Antiguo 29/01/2013, 15:41
 
Fecha de Ingreso: septiembre-2008
Ubicación: Sevilla, España
Mensajes: 124
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Opción de Pin It en cada imagen

¿nadie? u.u
  #3 (permalink)  
Antiguo 30/01/2013, 05:59
Avatar de jrlopez  
Fecha de Ingreso: marzo-2008
Mensajes: 120
Antigüedad: 16 años, 1 mes
Puntos: 17
Respuesta: Opción de Pin It en cada imagen

Creo que podrias cambiar target="_top" por target="_blank"

o sino funciona podrias adicionar en slug.attr( al final de todo) + '&target' = '_blank'

No se, podria funcionar
__________________
Twitter:@jaimeraullopez
  #4 (permalink)  
Antiguo 31/01/2013, 04:22
 
Fecha de Ingreso: septiembre-2008
Ubicación: Sevilla, España
Mensajes: 124
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Opción de Pin It en cada imagen

No, eso solo hace que se abra en otra pestaña, y yo necesito un pop up, no otra pestaña.
De todas formas gracias por tu respuestas.

Etiquetas: boton, imagenes, javascript, pinterest, pop-up, social-media
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:33.