472,805 Members | 3,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Ajax Updatepanel and Manual scroller

Hi all !!
I have a difficult issue. I use the Manual Scroller script from dynamicDrive. This script is full working and is cross-browser. The url is for it, is http://www.dynamicdrive.com/dynamici...nualscroll.htm.
I am using a simple example. I have two updatepanels.
The first has a linkbutton inside so when I click it, I show some text in the second updatepanel. I want the scroller to contain the text of second updatepanel.
All the javascript code is inside the second updatepanel But when I run my aspx, i get two different errors: “movedown is not defined” OR “crossobj.offsetHeight is undefined”

If I remove the javascript, the aspx works perfectly.

thanks in advanced

Expand|Select|Wrap|Line Numbers
  1.  <script language="JavaScript1.2" type="text/javascript">
  2.           // script from the site http://www.dynamicdrive.com/dynamicindex2/manualscroll.htm                 
  3.  
  4.                   var crossobj=document.getElementById? document.getElementById("content") : document.all.content;
  5.                    var contentheight=crossobj.offsetHeight;
  6.                    function movedown()
  7.                    {
  8.                       if (window.moveupvar) clearTimeout(moveupvar)
  9.                       if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
  10.                        crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
  11.                        // else if (ns4&&crossobj.top>=(contentheight*(-1)+100)) crossobj.top-=speed
  12.                        movedownvar=setTimeout("movedown()",20)
  13.                    }
  14.  
  15.                    function moveup()
  16.                   {
  17.                       if (window.movedownvar) clearTimeout(movedownvar)
  18.                       if (iens6&&parseInt(crossobj.style.top)<=0)
  19.                       crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
  20.                        // else if (ns4&&crossobj.top<=0) crossobj.top+=speed
  21.                       moveupvar=setTimeout("moveup()",20)
  22.                    }
  23.  
  24.                    function stopscroll()
  25.                    {
  26.                        if (window.moveupvar) clearTimeout(moveupvar)
  27.                        if (window.movedownvar) clearTimeout(movedownvar)
  28.                    }
  29.  
  30.                    function movetop()
  31.                    {
  32.                        stopscroll();
  33.                       if (iens6) crossobj.style.top=0+"px";
  34.                        // else if (ns4) crossobj.top=0
  35.                    }
  36.  
  37.                    function getcontent_height()
  38.                    {
  39.                        if (iens6)  contentheight=crossobj.offsetHeight;
  40.                        // else if (ns4) document.nscontainer.document.nscontent.visibility="show"
  41.                    }
  42.  
  43.  
  44.                   window.onload=getcontent_height();                   
  45.  
  46.            </script>
Nov 24 '07 #1
1 1736
kenobewan
4,871 Expert 4TB
There was a lot of unnecessary code, so I removed it. As you indicated this seems to be a JS problem. I'd like to say told you so, but I won't. I believe there is a problem with calling movedown within the function, I usually use it outside when it is called. I have seen it used inside conjunction with an object so this could be a referencing error, but never had the occasion to use this myself. HTH.

MODERATOR
Nov 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: =?Utf-8?B?SmFrb2IgTGl0aG5lcg==?= | last post by:
I am new to AJAX. I am applying AJAX to a current web solution to get the "instant behaviour". On my main page I have two sets of criteria: Specific and Wide. Each set is placed in a View...
4
by: bbawa1 | last post by:
When I add updatePanel control in my aspx page it gives me following error. Unknown server tag 'ajax:UpdatePanel
2
by: =?Utf-8?B?VG9u?= | last post by:
Hello, I want to understand teh benefits of ajax technology. Does anyone has a good website where AJAX EXTENSIONS is worked out so I really understand it. There a 2 main questions: 1) How about...
0
by: Nightcrawler | last post by:
I hope this is the right group for this question. I recently started looking into AJAX and I am doing the following: I have a repeater (dummydata) that is bound to a datatable (Articles). Each...
7
by: MikeB | last post by:
Hello All, I am new to ajax and wanted to start by trying something simple. I have a web form with an updatepanel and then inside the update panel I have a listbox. Then outside of the updatepanel...
1
by: abellix | last post by:
An updatepanel contains a datagrid, this datagrid has columns generated by code-behind: some columns should have async postback, others should have sync postback. Here a sample to reproduce the...
1
by: =?Utf-8?B?T2xlZw==?= | last post by:
Hi, I'm wondering if anybody using ajax extensions where UpdatePanel tag is used in addition to existing ajax implementation where UpdatePanel wasn't used yet. So, there is already a web project...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
1
by: Mark B | last post by:
This is my first try at using AJAX. I want the calendars to be enabled if the user checks CheckBox1. It works OK for a normal all page refresh but once I introduced the AJAX code it stopped...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.