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

  • Home
  • SEARCH
  • 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 6065663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:24:56+00:00 2026-05-23T09:24:56+00:00

Im trying to create a fade effect between two images just using one image

  • 0

Im trying to create a fade effect between “two” images just using one image in two containers and shifting the background postion. Below is the following HTML markup I’m working with.

<div class="project">
    <a href="b-portfolio-detail.php?project=52"><img src="../projects/life4wrd.jpg" alt="Life4wrd" border="0" /></a>
    <a href="b-portfolio-detail.php?project=53" class="cover" style="background-position:0 -302px;">Life4wrd</a>
</div><!--/project-->

And here is the little jQuery I have.

$('.project img').attr('src');

There are multiple div.project contains, each with their own thumbnail. What I would like to do for each project div is to get the src from the img in the first anchor link and set that as a background for the second anchor link, (the one with the class called “cover”) and also set the background position on the div.cover to 0px -302px.

I understand how to get the img src attribute but Im not sure how to get it for each div.project and also how to pass it back in a the background image for .cover.

  • 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-23T09:24:56+00:00Added an answer on May 23, 2026 at 9:24 am
    $('.project .cover').css({display:'none',backgroundPosition:'0 -302px'}).attr('src',$('.project img').attr('src')).fadeIn();
    $('.project img').fadeOut();
    

    something like this?

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

Sidebar

Related Questions

i am trying to create a fade effect with the following...ive been told im
I'm trying to create an effect where you click on a thumbnail image, and
I'm trying to create a simple image gallery where I have one big photo
I'd like to create the highlight/fade effect as demonstrated at: http://docs.jquery.com/UI/Effects/Highlight However, I'm trying
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I'm trying to create a sitemap using Linq to Xml, but am getting an
I'm trying to create a transparent (no button background) ImageButton that has a custom
I'm trying to create a never-ending looping animation using ExtJs, but am hitting the
I am trying to create a nice state transition where I have 2 containers
I am trying to create 3 table view cells using code (w/o nib). I

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.