Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7404721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:17:45+00:00 2026-05-29T05:17:45+00:00

Here is the test page: http://grozav.com/test.php I’m trying to add a jquery function to

  • 0

Here is the test page:
http://grozav.com/test.php

I’m trying to add a jquery function to each image from the mysql database table.
Here is the generated code:

<div class="thumb" id="grozav-thumb">
<a class="ajax" href="gallery/grozav.html">
<p class="work-type">MOTION GRAPHICS</p>
<img src="http://grozav.com/images/thumbs/grozav-bwthumb.jpg" alt=""/>
<img src="http://grozav.com/images/thumbs/grozav-thumb.jpg" alt="" class="color"/>
</a></div>

I need a function which creates a code for each div with the class thumbnail. The outcome should be like this:

*thumbnail() is a function

thumbnail('divid');

which is something like

thumbnail('grozav')

Thanks a lot!


After reading the advices here, I’ve changed the code into:

function thumbnail(param1){
$(param1).hover(
    function() {
        $(param1+' .color').hide().stop().fadeTo(500,'1');
    },
    function() {
        $(param1+' .color').stop().fadeTo(500,'0');
    }
) ;                 
};

for(var p in document.querySelectorAll('div.thumb'))

thumbnail(p.id);

EDIT
Problem solved.
I used the following jQuery code to do it, which seems to work fine.

$("div.thumb").each(function (){
    var id = $(this).attr('id');  
    thumbnail(id);});

Applies the function to each of the divs created through php. Thank you anyway guys!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:17:46+00:00Added an answer on May 29, 2026 at 5:17 am

    Problem solved. I used the following jQuery code to do it, which seems to work fine.

    $("div.thumb").each(function() {
        var id = $(this).attr('id');  
        thumbnail(id);
    });
    

    Applies the function to each of the divs created through php. Thank you anyway guys!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://steph.net23.net/work.php here is my test link. This page has a jquery script in it
I have a test page here: http://www.problemio.com/test.php and if you press Click To Test
hi here is my live page http://mehrdadkhoshbakht.com/test/index.html there is a jquery sliding animation on
I am working on this test page: http://problemio.com/test.php What I am trying to do
here is the test page http://www.studioteknik.com/html/test-portfolio.html I got no error, but no hover-slide effect...
I am trying to use the jQuery CSV plugin, as documented here: http://code.google.com/p/js-tables/wiki/CSV According
Here is a link to the page http://www.true-gamerz.net/test2.php if you look at the image,
Check the test page here http://rickchristie.com/testfocus.html Correct me if I'm wrong: onfocus happens when
Website test page: http://www.lantiis.com/indexold.html jsFiddle: http://jsfiddle.net/Guhb4/7/ I received help with the jQuery and it
I am working off this test page: http://www.comehike.com/test_fb_connect.php When the user logs in using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.