Water Crystals
Junior Member
Those who make no mistakes, don't make anything
Posts: 431
inherit
137395
0
Apr 26, 2024 21:11:57 GMT -8
Water Crystals
Those who make no mistakes, don't make anything
431
February 2009
watercrystals
|
Post by Water Crystals on Mar 10, 2017 1:02:07 GMT -8
I have a custom page where I'd like to display many rows of small images (roughly 50x50 pixels). The idea is that when the mouse hovers over a small image, a larger image pops up that will basically be visual info/etc about the item. This is not simply a resizing; I don't want a bigger version of the small image, but a new image entirely and of larger size. I want the sizes of small and large images to be as they are made, so I don't have to code the width/height myself.
I've searched endlessly and haven't found any HTML that can help me do this. I also want to keep the code as short as possible, given I intend to use this for approximately 160 images (with hundreds more over time - I'll be using this for a Pokemon Pokedex on my RPG site). If there's an easier way to show a database of small images (that pop-up a larger one on mouse-over), please tell me as I am open to better methods. A custom page is my best idea for that so far, as achieving this in a thread seems more frustrating/impossible.
Would really appreciate it if someone can help me out because I'm at a loss of how to achieve this.
|
|
Water Crystals
Junior Member
Those who make no mistakes, don't make anything
Posts: 431
inherit
137395
0
Apr 26, 2024 21:11:57 GMT -8
Water Crystals
Those who make no mistakes, don't make anything
431
February 2009
watercrystals
|
Post by Water Crystals on Mar 11, 2017 1:02:36 GMT -8
Bump?
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,285
January 2004
todge
|
Post by Todge on Mar 11, 2017 10:40:48 GMT -8
There are several ways of getting that effect, but here's one... <img class="pop_it" src="URL OF IMAGE" data-pop="URL OF POP-UP IMAGE"> <img class="pop_it" src="URL OF IMAGE" data-pop="URL OF POP-UP IMAGE"> <img class="pop_it" src="URL OF IMAGE" data-pop="URL OF POP-UP IMAGE">
<div id="image_pop"><img src="*"></div>
<script type="text/javascript"> $('#image_pop').hide(); $('.pop_it').each(function(){ $(this).mouseover(function(){ var src = $(this).attr('data-pop'); $('#image_pop>img').attr('src',src); $('#image_pop').toggle(); }); $(this).mouseout(function(){ $('#image_pop').toggle(); }); });
</script>
|
|
Water Crystals
Junior Member
Those who make no mistakes, don't make anything
Posts: 431
inherit
137395
0
Apr 26, 2024 21:11:57 GMT -8
Water Crystals
Those who make no mistakes, don't make anything
431
February 2009
watercrystals
|
Post by Water Crystals on Mar 11, 2017 22:26:10 GMT -8
Yes, that's what I wanted! Thanks, however I tested this with a large list of images (as I intend to use) and the popped up image appears at the bottom of the list with it pops up. So if I hover the mouse over the first item in a large list, you can't even see the popped up one as it's at the bottom.
Did I miss something, or...?
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,285
January 2004
todge
|
Post by Todge on Mar 12, 2017 9:19:38 GMT -8
You can move the orange part of the code where-ever you like, as that is the cell the pop-up image will appear. BUT, assuming you'd like it to appear in the same place of the screen regardless of the scroll position, you'd need to use CSS to give it 'fixed' position and the distance from the top and left of the screen you'd like it to appear instead..
#image_pop { position: fixed; top: 300px; left: 200px; }
|
|
Water Crystals
Junior Member
Those who make no mistakes, don't make anything
Posts: 431
inherit
137395
0
Apr 26, 2024 21:11:57 GMT -8
Water Crystals
Those who make no mistakes, don't make anything
431
February 2009
watercrystals
|
Post by Water Crystals on Mar 14, 2017 2:37:04 GMT -8
Maybe it's just one of those weeks, but I'm still confused. Does the fixed position simply mean area of screen, but not page? Such as, if I set it to the middle of the screen, when an icon is hovered over will the popped up image always be visible without scrolling? I'm also doing this all in html, on a custom page. If I can't add CSS right into that, could you please tell me exactly where the CSS needs to go? Locations of codes is not something I'm very good at figuring out, sorry. Really appreciate all the help though, and am excited to get this working!
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,285
January 2004
todge
|
Post by Todge on Mar 14, 2017 17:20:52 GMT -8
CSS can be added to the page using HTML using the <style></style> tags, so you can just wrap the code snippet I gave you in them, or you can add it directly to the div with...
<div id="image_pop" style="position: fixed; top: 300px; left: 200px;"><img src="*"></div>
And yes, a fixed position will make the pop-up appear in the same position on the screen regardless of scroll position. So if you omit the top and left attributes, the image would always pop-up in the top left of the screen, no matter what.
|
|
Water Crystals
Junior Member
Those who make no mistakes, don't make anything
Posts: 431
inherit
137395
0
Apr 26, 2024 21:11:57 GMT -8
Water Crystals
Those who make no mistakes, don't make anything
431
February 2009
watercrystals
|
Post by Water Crystals on Dec 23, 2017 23:33:14 GMT -8
This was working wonderfully until recently. Now the popped-up images (with the exception of the first one) flashes rapidly - so fast it can't be read and should come with an epilepsy warning. Does anyone know how to fix this so the images just display, not flash? I need this fixed ASAP as my site launches on the 2nd of January and it's a key function my members will need.
|
|
inherit
226544
0
Oct 5, 2018 10:29:39 GMT -8
Ulises
4,881
November 2015
umacklin
Ulises Weirdo
|
Post by Ulises on Dec 28, 2017 11:25:13 GMT -8
Can we get a link to the custom page?
|
|
Water Crystals
Junior Member
Those who make no mistakes, don't make anything
Posts: 431
inherit
137395
0
Apr 26, 2024 21:11:57 GMT -8
Water Crystals
Those who make no mistakes, don't make anything
431
February 2009
watercrystals
|
Post by Water Crystals on Dec 29, 2017 0:31:21 GMT -8
It's here: zyver.boards.net/page/pokedex but the site is on Maintenance Mode (I don't want to take it off until the RPG officially launches in a few days; don't want it public until then)
|
|