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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:46:39+00:00 2026-05-14T21:46:39+00:00

cms is generating content in this format. <ul id=slide_nav class=tabs> <a name=ctn2363_2465 id=ctn2363_2465 class=hidden></a><li

  • 0

cms is generating content in this format.

<ul id="slide_nav" class="tabs">
<a name="ctn2363_2465" id="ctn2363_2465" class="hidden"></a><li id="button_1"><a class="ohlord" href="javascript: void(0);" id="b1">Bookbag</a></li>
<a name="ctn2363_2466" id="ctn2363_2466" class="hidden"></a><li id="button_2"><a class="ohlord" href="javascript: void(0);" id="b2">help</a></li>
<a name="ctn2363_2467" id="ctn2363_2467" class="hidden"></a><li id="button_3"><a class="ohlord" href="javascript: void(0);" id="b3">Team</a></li>
<a name="ctn2363_2468" id="ctn2363_2468" class="hidden"></a><li id="button_4"><a class="ohlord" href="javascript: void(0);" id="b4">At</a></li>
</ul>

To get a correct index of the clicked link I have to do this in IE 7 (use class info in selector)

$("#slide_nav li a").click(function(){
   var index = $("#slide_nav li > a.ohlord").index(this);
}); 

On firefox $("#slide_nav li > a").index(this); works. On IE this produces incorrect index (0, 2, 4, 6 ..). Is there a way to get the correct index in IE 7 for the above html without using class information in the selector?

My second question is

$('#slides img')[index].attr('style', 'display: block;');

does not work. I have to iterate through each $('#slides img') elements to set the attribute. Isn’t HTMLElement object returned from $(‘#slides img’)[index] an jquery object?

  • 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-14T21:46:39+00:00Added an answer on May 14, 2026 at 9:46 pm

    To answer your first question, I think the problem is related to the list being badly-formed. The direct children of the UL should be LIs, which should wrap everything else. In your markup, an anchor occurs before each LI – that could be causing IE7 to choke.

    <a name="ctn2363_2465" id="ctn2363_2465" class="hidden"></a>**<--this is suspect, restructure**<li id="button_1"><a class="ohlord" href="javascript: void(0);" id="b1">Bookbag</a></li>
    

    To answer your second question, you can do this:

    $('#slides img').eq(index).attr('style', 'display: block;');
    

    or:

    $('#slides img:eq(' + index + ')').attr('style', 'display: block;');
    

    or:

    $('#slides img')[index].style.display = 'block;';
    

    or:

    $('#slides img').get(index).style.display = 'block;';
    

    The reason for that is[index] from your example, which is equivalent to .get(index), gets a DOM element, and not a jQuery object, hence .attr() does not work.

    As a final point, .show() can substitute for .attr('style', 'display: block;'); and don’t forget you can use .css() to get or set style properties, e.g. .css("display", "block");

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

Sidebar

Related Questions

In my CMS I've added this code <div><?php include(my_contact_form.php) ?></div> which updates to a
I am using a CMS system, which has a template for generating forms, with
I have a CMS generating a basic navigation using a UL. Each first-level LI
I am using a CMS for images which is by default not generating alt
EPiServer CMS 6 site that suddenly got this error in edit mode. Found alot
Working on N2 CMS I'm adding my own content type Product . I derive
I've been trying to improve my password hashing class for a CMS I'm currently
cms.xml has default value: <default> <reference name=footer> <block type=cms/block name=cms_footer_links before=footer_links> <action method=setBlockId><block_id>footer_links</block_id></action> </block>
I've got a CMS that takes some dynamic content and renders it using a
I've worked on a CMS which would use Smarty to build the content pages

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.