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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:57:04+00:00 2026-06-07T18:57:04+00:00

I have a javascript function using Jquery on my page. I want to make

  • 0

I have a javascript function using Jquery on my page. I want to make so that it will start this function automatically when the page loads, but so the user can also still interact with the function. It’s a function that involves selecting a link that will hide and fadeIn a new div. I am trying to have this happen automatically as well.

$(document).ready(function() {


        $('#tablecell1').click((function () {
    var last_image = null;

    return function () {
        if (last_image) {
            $('#tablecell1 .selected').attr('src', last_image).removeClass('selected');
        }

        var $clicked_image = $('img', this);
        last_image = $clicked_image.attr('src');
        $clicked_image.attr('src', 'NewsBarAZ/Article-Nav-Bar2_01.gif').addClass('selected');
        $('#img2').attr('src','NewsBarAZ/Article-Nav-Bar1_02.gif');
        $('#img3').attr('src','NewsBarAZ/Article-Nav-Bar1_03.gif');
        $('#img4').attr('src','NewsBarAZ/Article-Nav-Bar1_04.gif');
        $('#img5').attr('src','NewsBarAZ/Article-Nav-Bar1_05.gif');

    }
})());

    $('#tablecell2').click((function () {
    var last_image = null;

    return function () {
        if (last_image) {
            $('#tablecell2 .selected').attr('src', last_image).removeClass('selected');
        }

        var $clicked_image = $('img', this);
        last_image = $clicked_image.attr('src');
        $clicked_image.attr('src', 'NewsBarAZ/Article-Nav-Bar2_02.gif').addClass('selected');
        $('#img1').attr('src','NewsBarAZ/Article-Nav-Bar1_01.gif');
        $('#img3').attr('src','NewsBarAZ/Article-Nav-Bar1_03.gif');
        $('#img4').attr('src','NewsBarAZ/Article-Nav-Bar1_04.gif');
        $('#img5').attr('src','NewsBarAZ/Article-Nav-Bar1_05.gif');

    }
})());

    $('#tablecell2').click((function () {
    var last_image = null;

    return function () {
        if (last_image) {
            $('#tablecell2 .selected').attr('src', last_image).removeClass('selected');
        }

        var $clicked_image = $('img', this);
        last_image = $clicked_image.attr('src');
        $clicked_image.attr('src', 'NewsBarAZ/Article-Nav-Bar2_02.gif').addClass('selected');
        $('#img1').attr('src','NewsBarAZ/Article-Nav-Bar1_01.gif');
        $('#img3').attr('src','NewsBarAZ/Article-Nav-Bar1_03.gif');
        $('#img4').attr('src','NewsBarAZ/Article-Nav-Bar1_04.gif');
        $('#img5').attr('src','NewsBarAZ/Article-Nav-Bar1_05.gif');

    }
})());

    $('#tablecell3').click((function () {
    var last_image = null;

    return function () {
        if (last_image) {
            $('#tablecell3 .selected').attr('src', last_image).removeClass('selected');
        }

        var $clicked_image = $('img', this);
        last_image = $clicked_image.attr('src');
        $clicked_image.attr('src', 'NewsBarAZ/Article-Nav-Bar2_03.gif').addClass('selected');
        $('#img1').attr('src','NewsBarAZ/Article-Nav-Bar1_01.gif');
        $('#img2').attr('src','NewsBarAZ/Article-Nav-Bar1_02.gif');
        $('#img4').attr('src','NewsBarAZ/Article-Nav-Bar1_04.gif');
        $('#img5').attr('src','NewsBarAZ/Article-Nav-Bar1_05.gif');

    }
})());

    $('#tablecell4').click((function () {
    var last_image = null;

    return function () {
        if (last_image) {
            $('#tablecell4 .selected').attr('src', last_image).removeClass('selected');
        }

        var $clicked_image = $('img', this);
        last_image = $clicked_image.attr('src');
        $clicked_image.attr('src', 'NewsBarAZ/Article-Nav-Bar2_04.gif').addClass('selected');
        $('#img1').attr('src','NewsBarAZ/Article-Nav-Bar1_01.gif');
        $('#img2').attr('src','NewsBarAZ/Article-Nav-Bar1_02.gif');
        $('#img3').attr('src','NewsBarAZ/Article-Nav-Bar1_03.gif');
        $('#img5').attr('src','NewsBarAZ/Article-Nav-Bar1_05.gif');

    }
})());

    $('#tablecell5').click((function () {
    var last_image = null;

    return function () {
        if (last_image) {
            $('#tablecell5 .selected').attr('src', last_image).removeClass('selected');
        }

        var $clicked_image = $('img', this);
        last_image = $clicked_image.attr('src');
        $clicked_image.attr('src', 'NewsBarAZ/Article-Nav-Bar2_05.gif').addClass('selected');
        $('#img1').attr('src','NewsBarAZ/Article-Nav-Bar1_01.gif');
        $('#img2').attr('src','NewsBarAZ/Article-Nav-Bar1_02.gif');
        $('#img3').attr('src','NewsBarAZ/Article-Nav-Bar1_03.gif');
        $('#img4').attr('src','NewsBarAZ/Article-Nav-Bar1_04.gif');

    }
})());


     $('.preview').hide();

  $('#link_1').click(function(){ 
      $('#latest_story_preview1').hide();
       $('#latest_story_preview2').hide();
      $('#latest_story_preview3').hide();
      $('#latest_story_preview4').hide();
      $('#latest_story_main').fadeIn(800);
  });   

  $('#link_2').click(function(){ 
      $('#latest_story_main').hide();
      $('#latest_story_preview2').hide();
      $('#latest_story_preview3').hide();
      $('#latest_story_preview4').hide();
      $('#latest_story_preview1').fadeIn(800);
  });

  $('#link_3').click(function(){ 
      $('#latest_story_main').hide();
      $('#latest_story_preview1').hide();
      $('#latest_story_preview3').hide();
      $('#latest_story_preview4').hide();
      $('#latest_story_preview2').fadeIn(800);
  });

    $('#link_4').click(function(){ 
      $('#latest_story_main').hide();
       $('#latest_story_preview1').hide();
      $('#latest_story_preview2').hide();
      $('#latest_story_preview4').hide();
      $('#latest_story_preview3').fadeIn(800);
  });
    $('#link_5').click(function(){ 
      $('#latest_story_main').hide();
       $('#latest_story_preview1').hide();
      $('#latest_story_preview2').hide();
      $('#latest_story_preview3').hide();
      $('#latest_story_preview4').fadeIn(800);
  });


    });
  • 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-07T18:57:07+00:00Added an answer on June 7, 2026 at 6:57 pm

    you can use .trigger() for triggering any event in code

    as

      $('#link_1').trigger('click');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Javascript code (using jQuery): floatUpAndDown(); function floatUpAndDown() { $(#bird).animate({top: '+=30px'},
I have updated my jSon object using the code <script type=text/javascript > jQuery(document).ready(function($){ var
I have a variable that I'm using to build a JavaScript function call, and
I have a canvas that I am using a javascript function to display text
I have a view using a master page that contains some javascript that needs
I have a JSP page that creates a treeview using jQuery treeview plugin. Now
I have a javascript client passing a parameter to a server function (I'm using
I have the following JavaScript I am using to save selected check boxes: function
I have Javascript function defined in the main index.html file. One part of this
This is my first time using JQuery in any of my projects. I have

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.