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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:58:24+00:00 2026-06-10T19:58:24+00:00

I have this variable var item_width = $(‘#slides li’).outerWidth(); and want to modify it

  • 0

I have this variable

var item_width = $('#slides li').outerWidth(); 

and want to modify it to include #slides2 li as well. Do i have to write two vars and use them in their respective functions or is there a way to include both IDs in a single line?

I am doing this because I have two divs (that toggle) containing two different slide carousels and am trying to share as much of the scripts as possible.

// EDITED to extrapolate //

i’m missing something simple here, i just know it. the first div works no problem, the second just won’t work. should i use classes instead? (that may be a dumb question, but i’m VERY new to JS)

there is quite a bit of code and i couldn’t get the jsfiddle working so i just posted a dev doc to our production site.

(url deleted)

// EDIT //

nevermind, the problem was with the css, not the script. adding clear: both to #slides ul, #slidesTwo ul put them all on a separate line. they were all floating left outside of the ul

  • 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-10T19:58:25+00:00Added an answer on June 10, 2026 at 7:58 pm
    var item_width = $('#slides:visible li,#slides2:visible li').outerWidth(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have declared this variable in jquery var enabled = false; I want to
I have this variable: $timestamp = strftime(%Y-%m-%d %h:%M:%S %a, time ()); I simply want
I'm using magnolia and I have this variable: ${def.parameters.subTemplate} I want to set the
In PHP i have this string variable: $var = 00480722 ZF452D041502 13 9900 153370178;
I have this jQuery snippet, I have stored the variables to highlight them. var
In Actionscript you can have global variables like this: var number : Number =
I have a map array with objects stuffed with variables looking like this: var
I have this variable defined in my web.config file : <appSettings> <add key =version
unordered_map<std::string,unordered_map<std::string, std::string> >* storing_vars; I have this variable in the scope declared in the
So in a js file I have this: if(players[i].src.indexOf(http:\/\/vimeo.com/moogaloop) == 0){ var videoId =

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.