• 0

Please help with my jquery issue, 2 scripts together


Question

I'm trying to get 2 jquery scripts to both work on the same page. One just shows text over a thumbnail when it's hovered over, the other just expands the thumbnail when it's click on. I'm so close I can almost taste it but I'm totally stumped now :/  To make things easier, here is a tiny .zip so you can see what I'm doing. http://www.classicdragons.org/TEMP.zip

 

Just open temp.html and you can see that the hover over jquery works perfectly, but clicking does nothing. Then just remove this from temp.html :

 

$(function() {
    $('img').hover_caption();
  });

 

...and you will see that the hover jquery is now of course broken but now the click to expand the thumbnail jquery works.

 

I'm desperately trying to get these to work together! Please help, I would really appreciate! Thank you in advance!!!!

 

Alex

14 answers to this question

Recommended Posts

  • 0

Ok, so far it appears that the overlay is getting in the way of letting you click the actual image when it is created. I am still looking.

 

EDIT: What about just changing the height of the caption overlay so it doesn't take up the whole image?

Edited by winlonghorn
  • 0

With help from winlonghorn, he has helped me so the hover over works and when I click on the image, it brings up the viewer. However the full image doesn't display in the viewer.

 

I have updated the link in my OP to reflect where I stand currently. I'm so close now! Just need to figure out why the image doesn't display in the viewer.

 

Any help much appreciated! Thanks!

  • 0

The reason that you don't see the full image is because of this code in /css/jsgallery.css:

 

.jsgallery-container #jsgall_imageContainer:before {    /* create a full-height inline block pseudo=element */
    content: ' ';
    display: inline-block;
    vertical-align: middle !important; 
    height: 100%;
}

That code is inserting a block above your full size image in the viewer that is the full height of the page, thus the full image is pushed off of the screen. Removing that style block makes your full-size image visible.

  • 0

When I remove that, the image appears, but then the full size image still has the shadow covering it until I move the courser off screen. Plus clicking anywhere doesn't remove the full size, it just reloads it.

 

But that is a step forward, thanks!!!!!!! I've been stuck on this for weeks lol.

  • 0

The reason that clicking on the full-size image doesn't close the full-size view is because you've setup the gallery script to run whenever an <img/> is clicked. Since the full-size image is rendered as an <img/> tag, clicking on it actually runs the gallery script again.

  • 0

I simply want to be able to mouse over an image (it's an art gallery web page with dozens of thumbnails on a page), the mouse over display a description of the image, then if clicked, the full size image shown. Then clicking anywhere will exit out of the full image view, or clicking next or swiping next when in full image view go to the next images in full size.

 

Thanks for any help, this is really challenging me, not my programming expertise at all :/

Edited by anguilla1980
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Idiots never imagine their insane actions troubling everyone.  
    • Photo Variants 2.3 by Razvan Serea Photo Variants is an all-in-one photo editor for Windows. Quickly cull, import, and edit your images with powerful tools. Enjoy full layer support, precise retouching features, and a wide range of filters and color adjustments. Create multiple versions of a photo instantly with presets, or design from scratch using vector graphics and advanced editing options. Free for personal and commercial use. Photo Variants key Features: Advanced Adjustment Tools: Provides precise control over image modifications. ​ Extensive Filter Collection: Offers over 99 photo filters to apply various effects. ​ Animated Photo Effects: Enables the addition of dynamic elements to images. ​ Automatic Face Retouching: Includes features for enhancing facial features automatically. ​ Support for Multiple Formats: Compatible with over 100 graphic formats, including RAW and PSD files, allowing users to open, edit, and save in these formats. ​ Drawing and Transformation Tools: Facilitates freehand drawing, erasing, filling, cropping, resizing, rotating, and flipping images. Photo Variants supports a wide array of image formats, making it a versatile tool for all your editing needs. Key supported formats include: Raster Formats: .jpeg, .jpg, .png, .bmp, .gif, .tiff, .webp, .ico, .pcx. Camera RAW: .crw, .cr2, .dng, .nef, .raf, .arw, .orf, .x3f, .raw. Professional Formats: .psd, .ai, .svg, .tga, .pdf, .pcl. Specialized Formats: .dicom, .dcm, .heic, .heif, .avif, .exr, .dds. Other: .wmf, .emf, .xps, .jpeg2000 (.jp2)...etc... With support for these formats, Photo Variants offers seamless editing and flexibility for photographers, designers, and creatives. Photo Variants 2.3 changes: New effects for layers. New shapes and options for brushes. Download: Photo Variants 2.3 | 70.5 MB (Freeware) View: Photo Variants Home page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Internal PSU for these applications is bueno. External would be prone to noise and that is exactly something you do not want.
    • Google may finally be developing an answer to Apple's Live Activities by David Uzondu When Live Activities launched with iOS 16, Apple gave iPhone users a dynamic way to track stuff like sports scores and food deliveries right on the lock screen. Almost two years later, Samsung followed with the "Now Bar," a similar pill-shaped widget on its One UI 7.0 software. Both features are quite useful, solving the same problem of saving you a trip into an app for a quick update. As for user adoption, there are no official numbers, but in 2023, Business of Apps estimated that 41% of iPhone users had already tried Live Activities, with 62% of them rating their experience as "Good" or "Exceptional." Based on that data, it is a popular feature, even with its technical hurdles for developers, like the tight 4KB limit for update data. Now, it looks like Google is finally getting its own version ready for Pixel phones. According to a code teardown by Android Authority, evidence is mounting for a new feature, the so-called Gemini Space, which will likely debut with the Pixel 10 later this year before making its way to older devices. The first clues appeared in a system file from a recent Android beta, named "Ambient Data." This file was found in the firmware for both the Pixel 9 Pro and the Pixel 8 Pro, which suggests current phone owners might not be left out in the cold. What this "Ambient Data" actually does is anyone's guess, but the name itself points toward "contextual information" living on your always-on display. Further digging into the Android System Intelligence app, which powers the Pixel's existing "At a Glance" widget, unearthed more direct connections. Code strings explicitly link "Gemini Space" to new At a Glance capabilities. Android Authority got the finance recap and sports scores, features that have been floating around in rumors for a bit. This has led to a strong theory that Gemini Space could be a rebrand of At a Glance, with more capabilities. Related references also point to an "Ambience Hub," which could function as a more expansive, full-screen summary, much like Samsung's Now Brief complements its Now Bar. As Android Authority notes, you could argue that At a Glance already does this, but its current implementation feels limited compared to the competition. A repositioning of the widget to the bottom of the lock screen was even tested last year, which would make it look a lot like Apple's and Samsung's offerings. If this reporting is on the money, Gemini Space could finally give Pixel users the rich, glanceable updates that other phone users have had for a while.
  • Recent Achievements

    • Week One Done
      Wayne Robinson earned a badge
      Week One Done
    • One Month Later
      Karan Khanna earned a badge
      One Month Later
    • Week One Done
      Karan Khanna earned a badge
      Week One Done
    • First Post
      MikeK13 earned a badge
      First Post
    • Week One Done
      OHI Accounting earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      692
    2. 2
      ATLien_0
      269
    3. 3
      Michael Scrip
      204
    4. 4
      +FloatingFatMan
      169
    5. 5
      Steven P.
      144
  • Tell a friend

    Love Neowin? Tell a friend!