I want to add some text on image hover in my site's images; When mouse cursor goes on the image, Show some text about that image.
I want to add some description about that image.
But i want box be as is on this site:
http://libeskind.com/work/
Please see link, and tell me how can i do that pls?
I want that be as like as link example
Thanks all
It is an easy job check out my example , i just made a simple example i did not added transition's as i think it will help you in learning , try to understand the code it is really easy.
.imgc{width:100px;}
.imgc img{height:200px}
.imgc p {position:absolute;transition:1s all;padding:10px;background:#ddd;width:240px;display:none;margin-top:-20px}
.imgc:hover > p{display:block;}
<div class='imgc'>
<img src='http://libeskind.com/wp-content/uploads/aerial-view-c-guenter-schneider-555x426.jpg' />
<p>Hello World</p>
</div>
Related
Is it possible to realize a 3D rolling link (click for example) with a different content when rolling? So let's say there is a DIV, and when the user hover over the DIV, the DIV spins (like in the example) and shows another DIV with another (clickable and with different action) content? Do you think this is possible just in CSS, or is there JS needed?
yes, see here an example: demo rotating cube
and here you can find a description description
The example you gave allows it.
JSfiddle
You just have to change the data-title in the HTML...
<div id="reveal">
<a href="http://zsitro.com/" class=" roll">
<span data-title="****CHANGE-ME****">H5BP build script</span>
</a>
</div>
I've been trying to create an effect where I hover over an image and the entire image goes white with text but my code isn't working, would anyone mind talking a look at letting me know what i've been doing wrong? http://jsfiddle.net/MBsbj/
<div class="frontImages"><img class="alignnone size-full wp-image-24" alt="biryani sideimage" src="http://tandoorifreshonline.com.mlseo.net/wp-content/uploads/2013/11/biryani-sideimage.png"/>
<div class="hoverText">HOVER TEXT HERE</div>
</div>
$('.frontImages').mouseenter(function(){
$('.hoverText').fadeIn();
});
.hoverText {
display:none;
}
Note - this code was based off of this thread: Show text when the cursor hovers over an image - however when I entered the code from the answer, it doesn't seem to work either. http://jsfiddle.net/nMCbY/
Thanks!
Your code works as it is you should only add an reference to jQuery in your JSFiddle to make it work. See your updated fiddles: http://jsfiddle.net/MBsbj/1/ and http://jsfiddle.net/nMCbY/1/
I've also edited the second fiddle to position the caption over the image, instead of under by adding:
caption.offset({ top: image.position().top })
See: http://jsfiddle.net/nMCbY/3/
So, I have this project to do for school and and partially got my answer from Reveal image underneath a mask css/javascript which is awesome.
The thing is, I do not want the color to move when I point my mouse over to the glass. Instead, what if I have 5 small thumbnails of different colors (listing on the side of the glass), which when I point to each of them, that would be the color moving in the glass. Is that possible? Would someone help me please.
Thank you very much!
Basically you need to change the color of the div that is the water "animation". Which you can easily do with $("div").css("background-color", color); that is attached to events on some display objects (5 small thumbnails in your case).
Here is a small example # JSFiddle: http://jsfiddle.net/MartinTale/Mz6VH/1/
As Martin said, you can simply change the background color based upon what you are hovering. However this can be slightly problematic if you then hover over a different color (the color will then switch before finishing the animation).
If you have some markup like this:
<img src='http://www.videsignz.com/testing/images/water-front2.png' />
<div id="blue-fill"></div>
<div id="red-fill"></div>
<div id="green-fill"></div>
<div class="thumbnails">
<div id="blue"></div>
<div id="red"></div>
<div id="green"></div>
</div>
And you can use this line of jQuery in your function to get the corresponding element
var theFill = "#" + $(this).attr("id") + "-fill";
This is basically grabbing the id of the current hovered element and concatenating on the format of your fill selector.
You can then grab select your fill using
$(theFill)
and animate from there. I made a codepen example with class attributes and the required css for styling: http://codepen.io/prythm/pen/Lwoyd
When I search images using Bing.com, I realize their images are well cropped and sorted. When you place your mouse on an image, another window will pop up with an enlarged image.
http://www.bing.com/images/search?q=Heros&FORM=BIFD#
I want to do the same thing in my program. I checked the source code of their page. They are using javascript, but still I have no clue how they make it. Does anyone familiar with it? Any suggestion is welcomed.
If you look at the HTML, you'll see a span immediately above each of the images. It sets that frame's display style from "none" to "block". It then uses an animation library to resize the content of the covering frame.
It's the same image. It just enlarges it slightly.
Here's a simple HTML/CSS/Javascript example on changing the display property of an element with javascript:
HTML:
<div id="image1" class="image" onmouseover="showImg(1);">
Here's the small image
</div>
<div id="bigImage1" class="bigImage" onmouseout"hideImg(1);">
Here's the enlarged image and info about the picture
</div>
Javascript:
function showImg(num){
document.getElementById('bigImage' + num).style.display='block';
}
function hideImg(num){
document.getElementById('bigImage' + num).style.display='none';
}
CSS:
.bigImage{
display:none
}
They also use a fancy transition thing like scriptaculous's effect-grow found here.
I have a menu bar with hover effects, and now I want to place a transparent image with a circle and a "handdrawn" text over one of the menu items. If I use absolute positioning to place the overlay image above the menu item, the user will not be able to click the button and the hover effect will not work.
Is there any way to somehow disable mouse interaction with this overlay image so that the menu will keep on working just as before even though it's beneath an image?
Edit:
Because the menu was generated with Joomla I could not tweak just one of the menu items. And even if I could, I did not feel a Javascript solution was appropriate. So in the end I "marked" the menu item with an arrow outside the menu-item element. Not as nice as I had wanted it to be, but it worked out okey anyway.
The best solution I've found is with CSS Styling:
#reflection_overlay {
background-image:url(../img/reflection.png);
background-repeat:no-repeat;
width: 195px;
pointer-events:none;
}
pointer-events attribute works pretty good and is simple.
So I did this and it works in Firefox 3.5 on Windows XP. It shows a box with some text, an image overlay, and a transparent div above that intercepts all clicks.
<div id="menuOption" style="border:1px solid black;position:relative;width:100px;height:40px;">
sometext goes here.
<!-- Place image inside of you menu bar link -->
<img id="imgOverlay" src="w3.png" style="z-index:4;position:absolute;top:0px;left:0px;width:100px;height:40px;" \>
<!-- Your link here -->
<a href="javascript:alert('Hello!')" >
<div id="mylinkAction" style="z-index:5;position:absolute;top:0px;left:0px;width:100px;height:40px;">
</div>
</a>
</div>
What I've done:
I've crafted a div and sized it to be what a menu option could be sized to, 100x40px (an arbitrary value, but it helps with illustrating the sample).
The div has an image overlay, and a link overlay. The link contains a div sized to be the same as the 'menuOption' div. This way a user click is captured across the whole box.
You will need to provide your own image when testing. :)
Caveat:
If you expect your menu button to respond to the user interaction (for example, changing color to simulate a button), then you will need extra code attached to the javascript you will invoke on the tag, this extra code could address the 'menuOption' element through the DOM and change it's color.
Also, there is no other way I know of that you can take a click event, and have it register on an element underneath a visible page element. I've tried this as well this summer, and found no other solution but this.
Hope this helps.
PS:
The writeup on events at quirksmode went a long way to help me understand how events behave in browsers.
Give the button a higher z-index property than the hand-drawn image:
<img src="hand_drawn_image.gif" style="z-index: 4">
however, make sure you test it in all major browsers. IE interprets z-index differently from FF.
For somebody to come up with more details, you would have to post more info, a link would be best.
Building on what Pekka Gaiser said, I think the following will work. Taking his example and reworking it:
<a href="#" style="z-index: 5">
<!-- Place image inside of you menu bar link -->
<img src="hand_drawn_image.gif" style="z-index: 4">
<!-- Your link here -->
</a>
Here you should be able to place an event on the underlying a-tag and, unless your image has an event, initiates a capture (!IE browsers) and then kills propagation of the event.
If you need a bit more help, let us know a bit more about the situation.
If the image will be statically positioned, you can capture the click event from the image as it bubbles up, by placing the img tag inside the menu item element.
<div onclick="menuclick()">
<img src="overlay.png" style="position:absolute;" />
</div>