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 6205735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:19:35+00:00 2026-05-24T05:19:35+00:00

I am creating a portfolio image gallery for my website but I’m having some

  • 0

I am creating a portfolio image gallery for my website but I’m having some trouble… When I click on one of the icons the first image goes away (thats suppose to happen) but the next image won’t open…

Heres my code:

$(".portlink").click(function() {
    $(".large-image").addClass("hidden");

    var $alt = $(this).attr("alt");

    $(".", $alt).removeClass("hidden");
})

And my html/php…

    function portfolio() {
    $sql = "SELECT * FROM db ORDER BY id DESC";
    $res = mysql_query($sql) or die(mysql_error());

    while($row = mysql_fetch_assoc($res)) {
    ?>

        <div id="large-image" class="<?php echo $row['name'] ?> large-image hidden">
            <a href="<?php echo $row['website_address'] ?>"><img src="img/uploads/<?php echo $row['website_image'] ?>" alt="" /></a>
        </div>
    <?php
    }
} // End portfolio

function portfolio_nav() {
    $sql = "SELECT * FROM db ORDER BY id DESC";
    $res = mysql_query($sql) or die(mysql_error());

    while($row = mysql_fetch_assoc($res)) {
    ?>
        <div class="workbox"> 
            <div class="background pngfix"> 
                 <a class="portlink" alt="<?php echo $row['name'] ?>" href="#"><img src="img/uploads/<?php echo $row['website_image'] ?>" alt="" /></a>
            </div>  
        </div> 
    <?php
    }
} // End portfolio

please help!!

Thanks
Ben

  • 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-24T05:19:36+00:00Added an answer on May 24, 2026 at 5:19 am

    Just as a side note, you shouldn’t have multiple elements with the same id (all your divs have “large-image” as the id).

    I think your jQuery should look like this:

    $(".portlink").click(function() {
        $(".large-image").addClass("hidden");
    
        var alt = $(this).attr("alt");
    
        $("." + alt).removeClass("hidden");
    })
    

    (used a ‘+’ instead of ‘,’ in last line).

    If that doesn’t work check that $row[‘name’] is a string as you expect.

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

Sidebar

Related Questions

I am just planning on creating a portfolio website and before going any further
I'm creating simple application, some kind of portfolio. I've heard that it's better to
I'm finally getting round to creating a website for my print design portfolio. I
I'm creating a Django powered website that will have numerous applications (Blog, Shop, Portfolio,
I am creating a video portfolio website with a large quantity of videos and
I am creating a portfolio page for m personal site. I have a slider
I am creating a portfolio page for m personal site. I have a slider
Creating a simple RPG game, first time using XNA. Trying to get my character
I'm teaching myself Django and creating a personal portfolio site. I've setup a model
Right, last question for a while! I am creating a horizontal portfolio site and

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.