• Home
  • 1000 Efectos jQuery
  • 1000 Estilos Css
  • Foro
  • Freelance
  • Herramientas Web
  • Tu Granito de Arena!!
  • ZoneArtCss Móvil

Comparte en el FaceBook, twitter, delicius con el efecto Drag to Share en jQuery UI

Obtén una cuenta de @zoneartcss.com gratuita
Registrarse
Ver correo
Dic 12


Encontre este ejemplo muy bueno de como compratir tus temas, imagenes, en el facebook, twitter y delicius, con un efecto de arrastre facil.

Solo tienen que descargar la libreria Jquery UI para los efectos.

Ver Ejemplo

<html> 
  <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    <title>Drag to Share Example</title> 
    <link rel="stylesheet" type="text/css" href="dragToShare.css"> 
  </head> 
  <body> 
    <div id="content"> 
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> 
      <img src="rover.png" alt="Mars Rover"> 
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p> 
    </div> 
    <ul id="targets"> 
      <li id="twitter"><a href="http://twitter.com"><!-- --></a></li> 
      <li id="delicious"><a href="http://delicious.com"><!-- --></a></li> 
      <li id="facebook"><a href="http://www.facebook.com"><!-- --></a></li> 
    </ul> 
    <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> 
    <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script> 
    <script type="text/javascript"> 
	  $(function() {
 
		//cache selector
		var images = $("#content img"),
		  title = $("title").text() || document.title;
 
	    //make images draggable
	    images.draggable({
		  //create draggable helper
		  helper: function() {
		    return $("<div>").attr("id", "helper").html("<span>" + title + "</span><img id='thumb' src='" + $(this).attr("src") + "'>").appendTo("body");
		  },
		  cursor: "pointer",
		  cursorAt: { left: -10, top: 20 },
		  zIndex: 99999,
		  //show overlay and targets
		  start: function() {
		    $("<div>").attr("id", "overlay").css("opacity", 0.7).appendTo("body");
			$("#tip").remove();
			$(this).unbind("mouseenter");
			$("#targets").css("left", ($("body").width() / 2) - $("#targets").width() / 2).slideDown();
		  },
		  //remove targets and overlay
		  stop: function() {
		    $("#targets").slideUp();
			$(".share", "#targets").remove();
		    $("#overlay").remove();
			$(this).bind("mouseenter", createTip);
		  }
		});
 
		//make targets droppable
		$("#targets li").droppable({
		  tolerance: "pointer",
		  //show info when over target
		  over: function() {
		    $(".share", "#targets").remove();
		    $("<span>").addClass("share").text("Share on " + $(this).attr("id")).addClass("active").appendTo($(this)).fadeIn();
		  },
		  drop: function() {
		    var id = $(this).attr("id"),
			  currentUrl = window.location.href,
			  baseUrl = $(this).find("a").attr("href");
 
			if (id.indexOf("twitter") != -1) {
			  window.location.href = baseUrl + "/home?status=" + title + ": " + currentUrl;
			} else if (id.indexOf("delicious") != -1) {
			  window.location.href = baseUrl + "/save?url=" + currentUrl + "&title=" + title;
			} else if (id.indexOf("facebook") != -1) {
			  window.location.href = baseUrl + "/sharer.php?u=" + currentUrl + "&t=" + title;
			}
		  }		  
		});
 
	    var createTip = function(e) {
		  //create tool tip if it doesn't exist
		  ($("#tip").length === 0) ? $("<div>").html("<span>Drag this image to share the page<\/span><span class='arrow'><\/span>").attr("id", "tip").css({ left:e.pageX + 30, top:e.pageY - 16 }).appendTo("body").fadeIn(2000) : null;
		};
 
		images.bind("mouseenter", createTip);
 
		images.mousemove(function(e) {
 
		  //move tooltip
          $("#tip").css({ left:e.pageX + 30, top:e.pageY - 16 });
        });
 
	    images.mouseleave(function() {
 
		  //remove tooltip
		  $("#tip").remove();
	    });
	  });
	</script> 
  </body> 
</html>





Compartir   votar
¿Te gusto este tema?
Recibe en tu correo las ultimas actualizaciones

Escribe tu correo:

Recibirás un correo con todos los articulos escritos en ZoneArtCss durante el día.
Posted in Tips, jQuery. on Sábado, Diciembre 12th, 2009 by miguelortega Tags: delicius, efecto drag to shape, facebook, Twitter

Leave a Reply

Security Code:

ZoneArtCSS | Tu lugar: Del Arte CSS

  • Buscador
  • Suscribete
    Escribe tu correo:

    Recibirás un correo con todos los articulos escritos en ZoneArtCss durante el día.








  • Lo Último

    Un Administrador de Proyectos para un Diseñador WebUn Administrador de Proyectos para un Diseñador Web   39 Iconos Sociales para tu Sitio Web39 Iconos Sociales para tu Sitio Web   Editor de código online Editor de código online   Iconos para Redes SocialesIconos para Redes Sociales   ¿Cuantos usuarios online soporta tu sitio Web?¿Cuantos usuarios online soporta tu sitio Web?  


  • Ideas
  • Archivos
  • Comentarios
  • Populares
ajax alex aguiar cms codigo CSS Curl diseño efecto estilo facebook facil firefox fireworks fix flash gallery google gratis html ie6 i hate photoshop images Javascript jQuery js libreria liz palacios manual menu miguel ortega miguelortega Mootools php plugin problema solucion style Themes para dedalus tutorial Twitter video video tutorial web wordpress zoneartcss
  • Julio 2010
  • Junio 2010
  • Mayo 2010
  • Abril 2010
  • Marzo 2010
  • Febrero 2010
  • Enero 2010
  • Diciembre 2009
  • Noviembre 2009
  • Octubre 2009
  • Septiembre 2009
  • Agosto 2009
  • Julio 2009
  • Junio 2009
  • Navegar por internet gratis desde celular o móvil con telcel  628
    gabo, Andres, Roberto, miguelortega, Roberto, miguelortega [...]
  • Filtrar palabras de un post de formulario con PHP  2
    zonarock, dante
  • Simple Inicio de Sesión con Php y Mysql  3
    audio rodriguez, bk7, argos
  • Tu Granito de Arena!!  3
    miguelortega, edardo, la nena
  • CSS text-shadow  4
    miguelortega, Carlos, Luis, uJuan
  • Navegar por internet gratis desde celular o móvil con telcel {629}
  • Popin - Plugin jQuery para Pop-Ups {27}
  • Crear tu aplicación del facebook {18}
  • Personalizar en menú que sale cuando das clic secundario con JavaScript {16}
  • Beautiful Slide con jQuery {12}


  • Categorías
  • RSS Twitter
    Zoneartcss
    • Buen día a todos !! Espero que sea un excelente viernes :) hace 36 minutos desde TweetDeck
    • ahora zoneartcss.com ya tiene su versión para celulares, :) hace 22 horas desde TweetDeck
    • ZoneArtCss.com Versión Móvil http://goo.gl/fb/7sXzh 11:01:31 PM Julio 28, 2010 desde Google
    • Traductor con jQuery http://goo.gl/fb/oOXwj 10:47:11 PM Julio 28, 2010 desde Google
  • Enlaces
    • Alex Aguiar
    • Bienes Raices en Mérida
    • Blog SexyTec
    • Desarrollo Web
    • Descargas para Celular
    • Frogx3
    • Hosting en Mexico
    • Noticias en Cozumel
    • Playeras y Uniformes
    • SexyTec.net
    • WebAdictos
  • Home
  • 1000 Efectos jQuery
  • 1000 Estilos Css
  • Foro
  • Freelance
  • Herramientas Web
  • Tu Granito de Arena!!
   

Back to Top

© Copyright ZoneArtCSS | Tu lugar: Del Arte CSS. All rights reserved.
Designed by FTL Wordpress Themes brought to you by Smashing Magazine

  • Blogalaxia
  • http://www.wikio.es