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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:46:31+00:00 2026-06-07T13:46:31+00:00

So basically what I am trying to achieve is, when people click on first

  • 0

So basically what I am trying to achieve is,

  • when people click on first image, the rest will slide and fade, then the content loads up,
  • when people close, it will be back into 4 images,
  • when people click on 2nd image; images 1, 3 and 4 will slide and fade out, content shows up and so on.

I tried to play around with Jquery, and still ended up with zero result.

Here is the link:
http://homethai.com.au/testing/test.swf

  • 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-06-07T13:46:35+00:00Added an answer on June 7, 2026 at 1:46 pm

    This (with a bit of trial and error) is actually possible mostly through CSS, with plain JavaScript used only to toggle the class names (when a block is clicked and when a close link is clicked).

    If .block.active in the CSS is replaced with .block:hover so that each block will expand on hover, and the close links (and styles) are removed, then no JS is required at all.

    • Demo
    • Fiddle
    • Fiddle without displaying code, much less cramped

    HTML:

    <div class="block">
        <div class="closelink">X</div>
    </div>
    <div class="block">
        <div class="closelink">X</div>
    </div>
    <div class="block">
        <div class="closelink">X</div>
    </div>
    <div class="block">
        <div class="closelink">X</div>
    </div>
    

    CSS:

    body {
        text-align: center
    }
    .block {
        display: inline-block;
        position: relative;
        width: 60px;
        height: 60px;
        background: #08f;
        margin: 50px;
        cursor: pointer;
        border-radius: 8px;
        -moz-border-radius: 8px;
        -webkit-border-radius: 8px;
        transition: margin 1s;
        -moz-transition: margin 1s;
        -webkit-transition: margin 1s;
        -o-transition: margin 1s;
        -ms-transition: margin 1s;
        user-select: none;
        -moz-user-select: none;
        -webkit-user-select: none
    }
    .block .closelink {
        position: absolute;
        width: 20px;
        height: 20px;
        right: -20px;
        top: -20px;
        visibility: hidden;
        font-size: 14px;
        font-family: Segoe UI, Tahoma, Arial, Verdana, sans-serif;
        background: #ccc;
        border-radius: 4px;
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px
    }
    .block.active {
        margin-left: 200px;
        margin-right: 200px
    }
    .block.active .closelink {
        visibility: visible
    }
    

    JavaScript:

    window.addEventListener('load', init, false);
    function init() {
        var blocks = document.getElementsByClassName('block');
        var closeLinks = document.getElementsByClassName('closelink');
        for(i = 0; i < blocks.length; i++) {
            blocks[i].addEventListener('click', blockClicked, false);
        }
        for(i = 0; i < closeLinks.length; i++) {
            closeLinks[i].addEventListener('click', closeLinkClicked, false);
        }
    }
    function blockClicked(e) {
        var blocks = document.getElementsByClassName('block');
        for(i = 0; i < blocks.length; i++) {
            blocks[i].className = 'block';
        }
        e.target.className = 'block active';
    }
    function closeLinkClicked(e) {
        e.stopPropagation();
        e.target.parentElement.className = 'block';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically what I am trying to achieve is: if from date is entered then
I'm trying to achieve an image flowing out of a div. Basically, in my
Basically what I'm trying to achieve is a slide toggle effect but not quite.
Basically what i am trying to achieve is having the ul menu on the
Basically what I'm trying to achieve is a program which allow users to connect
I am basically trying to achieve what this page has: When clicked on an
Basically what I'm trying to achieve is the following:- I have a text box
I'm trying to achieve a small animated intro to a website. Basically I want
I'm basically trying to achieve this effect. It can be done with pretty much
Sorry for the poor title, but basically what I am trying to achieve is

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.