How to create the google plus one button effect using jquery? - javascript

When you look at the results on the google search page, you can see the google plus one button animation when you hover over the link or link description for every result.
I was searching internet but was not able to find any tutorial how to achieve this effect on a image or element in general.
Any suggestion or link to tutorial using jquery?
Thanks in advance.

It is one image containing multiple frames. I assume The image is used as background via CSS and the background position is changed rapidly (through JavaScript) to create the animation effect.
The image is:

Related

Appear effect on background image instead of <img> - Cursor trails jQuery

I found this awesome effect on codepen and I want to implement this effect on my own website on the background.
But the problem I have to face here is that the background image get set by wordpress and a plugin called visual composer. At the background image gets set as css backgorund image and not as an <img> div. But the code you see above on codepen.io is dealing with an <img> div.
So, I want to transfer and customize this code for my website to get it working there. The <div> in which you can find the background image on my website where I want to appear this effect is called ``. You can get the <div> of it by typing this in your console:
document.getElementsByClassName("vc_custom_1493329568717")
I already tried to recreate this effect on a local level. But I only could do it with an <img> div. So, here is my question. Does anybody has an idea, how I can transfer this effect to my website?
I would be very happy about an idea or an answer.
Kind regards and Thank You!

How is this possible? Animated JPG in Google Image Search results

I was searching for "Jaguar Rims" in google image results. I clicked on a plain photo that had no site logos or insignia on it. But after-the-click a promo of "39 photos" and the site address was populated onto the image.
How did they do this? I would like to re-create this effect
Was it an animated JPEG? Or rendered with Javascript? Keep in mind, I find this interesting only because it is happening within Google Image Search results.
This is the google image search I performed (it's 3rd image from the left but this could change).
Here is the image:
http://preview.netcarshow.com/Jaguar-XKR-2010-1600-21.jpg
It's not animating. The two images were likely cached at different times by google and the image publisher changed the image in-between those times.
I beleive the only way is with php. You can check the referer header and display a different image accordingly. This is how you check the header in php:
$_SERVER['HTTP_REFERER']
First you see icon data:image/jpeg;....... size: 259x194
After you click on it, you get similar image but scaled up:
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS1p2CI2vcgxkxMr8j8L0HfdmEBv_ggGM8RAri4-FWP9B0ENj9vDw
After part of second, you get full image, but becouse its big and it need time to load and resize, there is short time then you see #2 image.
http://preview.netcarshow.com/Jaguar-XKR-2010-1600-21.jpg
.#2 and #1 is same image, but without #2 part, seeing big image should take longer i guess after you click on icon.
So basically it is animation from 3 frames. icon -> bigger icon -> big image.
p.s. Google made icon from this one, that can be found in same site:
http://img2.netcarshow.com/Jaguar-XKR_2010_1024x768_wallpaper_21.jpg

Pulling data-caption from image with Elastic Image Slideshow, and display it on the page

I am using the Elastic Image Slideshow script, and would like to add data-caption text for each image, then display the text of the currently shown image into a div, outside of the slideshow (basically in a different section of the page.)
I found this script, to work with jQuery cycle, and tried to modify it to work but I am not having much luck.
Ok, I found this fiddle: http://jsfiddle.net/Snfst/6/ and modified it down to this:
$('img').hover(function(){
$('#caption').html($(this).data('caption'))
});
Question now is how do I get it to load without having to hover over the image, and only show the data for the currently shown image?
The page that I'm trying to make this work on might better show what I'm trying to do:
http://diguiseppi.com/Brad/Andy/portfolio-web-design.html

Can Photoshop's slice tool swap images on a web page?

I have a Photoshop image that I have created for December 1st. This image will be used as a calendar for an intranet site. Like any normal calendar, it has a door that I wish the user to press. I have a copy of the original document and in place of the door when the user presses this I want to show the new image so it looks like the user has reveled what is behind the door.
I thought I could achieve this task using Photoshop's slice tool. I can achieve this if my calendar door links to a URL, but not another .jpg file.
I also thought I might be able to complete this in Flash by importing my .jpg file and creating a link, but once again I think this is just for URL's.
I know that there is a better way to do this but I am short on time. Would ActionScript in Flash enable me to complete this task?
My original web site that will contain this image is Visual Studio 2005. It has some very basic JavaScript which automatically loads the correct image for each day (since I need 25 of these for the month of December [Day1.jpg, Day2.jpg etc etc]). This works fine. I just need to create the calendar images for each day and the content behind the door.
Yes, a simple actionscript using flash will help you. You can create a document with a button (the button will be the door, you can fill up the background of the button with the door image). Your flash movie may contain 2 keyframes (1 with the default background including the image-button and another keyframe with the image to be displayed when button-pressed). Add some actionscript for the button (basically a GoToAndPlay(# of keyframe with the image) and also a "stop()" action on the image keyframe. Here is a basic example on YouTube Click here. By the kind of thing I guess you want, a little bit of flash animation will make it look better i.e. (door opening clip, 2nd image slide, etc)
As Chris said, a simple JavaScript image swapping code will work too. Here are a couple of examples in StackOverFlow Click Here.
Also you can try some CSS, for example a DIV with the background door and a Hover action that sprite the background to the calendar (click would not be necessary, just hover). Here is a video
I hope any of those solution will work for you, I recommend the CSS one, because it can work with mobile devices, don't require javascript to be enabled, and it's fast and easy.

Draw a box on an image, javascript only?

What i want to do is have a user upload his image. When its complete it will display the image on the same page w/o refreshing. Here is the part i need to figure out, how do i have the user select a box in the image? so i can crop it when the user is done? (using ImageMagick).
If possible i would like a border for the user to stretch to edit the width and height. Then click within the rect to move around.
There's a ton of ways; including several pre-written plugins available through the web.
Are you using any frameworks?
Of the below, I've used Jcrop and Lasso.Crop and they've both worked out well. Haven't tried the others.
Here's a non-exhaustive listing:
Pure Javascript
http://www.dhtmlgoodies.com/index.html?whichScript=image-crop
jQuery
http://deepliquid.com/content/Jcrop.html
MooTools
http://www.nwhite.net/2009/02/25/lassocrop-preview/
Prototype
http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/

Categories