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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:38:50+00:00 2026-05-31T22:38:50+00:00

Hi I have been trying to create a crossfade plugin with previous and next

  • 0

Hi I have been trying to create a crossfade plugin with previous and next buttons from an already existing plugin: jqueryfancytransition .This is meant to be an exercise for me and after I manage to understand how it works I want to write my own for an website.I should mention that I am still very new to both Javascript and jQuery and that makes me sometimes waste alot of time on stuff that for others may seem very simple.One of these things simple things is the following:

I have noticed in the plugin that the author uses alot the method .id on the img’s I can’t find it in the jQuery API so I figure it’s a native Javascript method so I tried looking in the w3schools reference for Javascript can’t find it there either.At first I thought that this returns the id of the selected element but to my surprise while trying to create a simple example it didn’t:

<div id="slideshowHolder">
    <img src="nemo.jpg" alt="" id="ion"/>
    <img src="toystory.jpg" alt=""/>
    <img src="walle.jpg" alt=""/>
</div>

$(document).ready(function(){
    console.log($('div').id);
});

This seems to return undefined in the console.So my question is what those this method return and where can I read about it?.

Another thing I wanted to ask is if in jQuery you create a global function like this:

$.globalFunction = function(){}

Update: I know that id is an html element and I can select it in jQuery by using $(‘div#slideshowHolder’) or return it using the attr method but if id is just an html method then what does these piece of code mean

img[el.id] = new Array();

el is an img what those el.id return

  • 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-31T22:38:51+00:00Added an answer on May 31, 2026 at 10:38 pm

    Assuming $('div') returned an element (or many elements), they would be jQuery-wrapped elements, not plain DOM elements. Therefor they would not have an id property. If you want to get the id from a jQuery-wrapped element, you would use $('div').attr('id');.

    To answer your final question, which I believe you are asking about adding to the jQuery prototype, there are many good articles for this. I would suggest reading over helephant’s site. The jQuery object (jQuery or, as it is usually aliased, $) is just like any other object, so you can extend it’s prototype just like any other object.

    To answer your newly edited final question:

    img[el.id] = new Array();

    This is searching for the property id on the object el, using that value to search for a property el.id on img using the bracket notation since el.id is dynamic. If it finds this property on the img object it will erase it and assign it a new Array() object. If it does not find the property on the img object, it will create a new property on the fly and assign it a new Array() object.

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

Sidebar

Related Questions

I have been trying to create a code like this: If you show 'us.gif'
I have been trying to create beta invites that each existing user can send
I have been trying to create a menu panel with jQuery that can be
I have been trying to create a new google custom search engine, but when
I have been trying to create a simple program with Python which uses OpenCV
I have been trying to create an observable tweeter feed using tweetsharp with the
I have been trying to create an XML using the simplexml library (v2.6.2) http://simple.sourceforge.net/home.php
I have been trying to find a good guide to create a templated control.
Ok I'm stumped. I have been trying to use Simpletip to create a tooltip
I'm trying to create a friendship association. I found and have been following the

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.