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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:15:20+00:00 2026-05-25T13:15:20+00:00

Someone had a problem with their code on a different site and I noticed

  • 0

Someone had a problem with their code on a different site and I noticed the use of @ a lot in their code and I was merely curious to what it is and why he is using it.

Here is his code:

# check if supports css3
supports = (->
  div = document.createElement("div")
  vendors = "Khtml Ms O Moz Webkit".split(" ")
  len = vendors.length
  (prop) ->
    return true  if prop of div.style
    prop = prop.replace(/^[a-z]/, (val) ->
      val.toUpperCase()
    )
    while len--
      return true  if vendors[len] + prop of div.style
    false
)()

class HandleCarousel
  constructor: (wrapper, block_number) ->
    @block_number = block_number
    @wrapper = wrapper

  wrapper = null
  counter: 0
  block_number: 0
  loopTimeout = 5000
  loopTimer = null

  handleBlur: =>
    helpers.windowState = 'blur'
    window.clearTimeout(@loopTimer)
    @counter = 0
    # reset all
    target = @wrapper.find('ul')
    target.css({left: 0})
    target.clearQueue()
    target.find('ul').stop()
  handleFocus: =>
    if helpers.windowState == 'blur'
      helpers.windowState = 'focus'
      @start(5000)

  handleWindowState: ->
    $(window).blur(@handleBlur)
    $(window).focus(@handleFocus)

  loop: ->
    @counter++
    slider = @wrapper.find('ul')
    block = @wrapper.find('ul li')
    delta = parseInt(block.css('width'), 10) * @counter * (-1)
    if (@counter < @block_number)  
      # check css3 support
      if slider.hasClass 'css3'
        slider.css({'left': delta})
      else
        slider.animate({'left': delta},{duration: 500, easing: 'easeInSine'})
    else
      @counter = 0
      @wrapper.find('ul').css({left: 0})

    if (@counter is 0 || @counter is @block_number-1)
      if @counter is 0
        slider.removeClass 'css3'
      @loopTimeout = 2500
      #/
    else
      slider.addClass 'css3'
      @loopTimeout = 5000

    @start(@loopTimeout) #if helpers.windowState isnt 'blur'

  # start loop slider
  start: (time) ->
    console.log 'start'
    @loopTimer = window.setTimeout( =>
      @loop()
    , time)



helpers = {
  windowState: 'focus'
  iDevice: /iphone|ipad/i.test(navigator.userAgent.toLowerCase())
  updateOrientation: ->
    location.reload()
  hasTouch : /android|iphone|ipad/i.test(navigator.userAgent.toLowerCase())
  supportsTouch: -> # "'createTouch' in document" will return true in Apple's Mobile Safari. Otherwise detect Android directly.
    android = navigator.userAgent.indexOf('Android') != -1
    return android || !!('createTouch' in document)

}# /helpers


jQuery ->
  window.console ?=
    log:-> #patch so console.log() never causes error even in IE.

  if $('.carousel').length>0
    target = $('.carousel')
    if supports('textShadow')
      target.find('ul').addClass 'css3'
    firstImg = target.find('ul li:first').html()
    console.log firstImg
    target.find('ul').append('<li>'+firstImg+'</li>')
    carousel_items = target.find('li').length
    if carousel_items > 2
      carousel = new HandleCarousel(target, carousel_items)
      carousel.handleWindowState()
      carousel.start(carousel.loopTimeout)
  • 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-25T13:15:21+00:00Added an answer on May 25, 2026 at 1:15 pm

    That is not jQuery or JavaScript. It is CoffeeScript and will eventually get converted to JavaScript.

    @ is used to refer to properties on the current context (this). So CoffeeScript’s,

    @something
    

    is equivalent to JavaScript’s

    this.something
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Today I came across a problem where someone had accidentally committed a proj.user file
Wanted to know if someone had a suggestion on code or maybe there's a
I just found out because someone had a ' in their last name and
I noticed in another post, someone had done something like: double d = 3.1415;
In previous question of mine, someone had meantioned that using Semaphores were expensive in
I'm sure it's pretty straightforward since someone just solved a similar problem I had.
I'm sure it's pretty straightforward since someone just solved a similar problem I had.
In this question someone was having a layout problem because they had two floated
EDIT: Just to make sure someone is not breaking their head on the problem...
I saw a screencast where someone had gotten git st git ci to work.

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.