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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:52:31+00:00 2026-05-17T20:52:31+00:00

I am making a custom page in Facebook, using FBML and JavaScript on a

  • 0

I am making a custom page in Facebook, using FBML and JavaScript on a canvas tab.

I want to make a slider like you usually do with jQuery, unfortunately Facebook has no jQuery support (yet), so I figured I will make the slide with plain old JavaScript.

After using the slide() function once, I get “slide() is not a function” error in the Firebug console.

Here’s the code:

<script>
    <!--
        function slide(reqPos){
            desSlideState = reqPos;
            curSlideState = getCurSlideState();
            toSlide = desSlideState - curSlideState;
            pxToSlide = toSlide * (-520);

            movCount = 0;
            timer = setInterval(function(){eSlide(slide, pxToSlide);},100);
        }
        function getCurSlideState(){
            slide = document.getElementById("slider");
            var slideLeft = slide.getStyle("left");
            var slideLeft = parseFloat(slideLeft);
            var slideState = slideLeft/-520;
            return slideState;
        }
        function eSlide(elemToMove, lengthToMove){
            curLeft = elemToMove.getStyle("left");
            curLeft = parseFloat(curLeft);

            newLeft = curLeft + (lengthToMove/10);
            elemToMove.setStyle("left", newLeft + "px");

            movCount++;

            if(movCount == 10){
                clearInterval(timer);
                return false;
            }
        }
    //-->
</script>

<div id="fb-wrapper">
    <h1>Loads Solutions LTD</h1>

    <div class="loads-nav-wrap">

      <div class="fb-nav" id="nav1"><a href="http://www.loads.co.il/hosting.php" onclick="slide(0); return false;">Server<br />Hosting</a><div></div></div>

      <div class="fb-nav" id="nav2"><a href="http://www.loads.co.il/dedicated.php" onclick="slide(1); return false;">Dedicated<br />Servers</a><div></div></div>

      <div class="fb-nav" id="nav3"><a href="http://www.vcp.co.il/" onclick="slide(2); return false;">Web Design<br />&Development</a><div></div></div>

      <div class="fb-nav" id="nav4"><a href="http://www.loads.co.il/vps.php" onclick="slide(3); return false;">VPS</a><div></div></div>

      <div class="fb-nav" id="nav5"><a href="http://www.loads.co.il/exchange.php" onclick="slide(4); return false;">Exchange MailBoxes</a><div></div></div>
</div>

<div id="content-slide">
    <div id="slider" style="left:0">
        <div class="slide-content">
            <h3 id="test-id">content1</h3>
        </div>
        <div class="slide-content">
            <h3>content2</h3>
        </div>
        <div class="slide-content">
            <h3>content3</h3>
        </div>
        <div class="slide-content">
            <h3>content4</h3>
        </div>
        <div class="slide-content">
            <h3>content5</h3>
        </div>
    </div>
</div>

Don’t worry about HTML not being valid, Facebook canvas wouldn’t work otherwise.

  • 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-17T20:52:32+00:00Added an answer on May 17, 2026 at 8:52 pm

    This line here is overwriting your slide function:

    slide = document.getElementById("slider");
    

    You need a var to make it local, like this:

    var slide = document.getElementById("slider");
    

    Without the var it’s setting it as a global variable…overwriting your slide function from earlier. Always put var when declaring a local variable, otherwise it may cause global conflicts like it did here.

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

Sidebar

Related Questions

I'm making a custom list of nodes and their comments. I'd like to be
This is a question on making custom fields in Django. I'm making a field
I am trying to make a jquery similar tabs. since its for single use
I'm thinking about making a simple web application to practice custom tags, EL, ...
Well I need to implement the comments feature on a custom coded social networking
I am createing an external facing SharePoint site which contains a number of custom
I'm working on a traditional ASP.NET application making WCF service calls. Should I put
When I make a meeting in Outlook, the recipient gets a approve/reject button in
I'm trying to create a universal header for a website built on CodeIgniter, and
This is probably a Wordpress issue more than a Friendfeed issue but could be

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.