473,382 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 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 1762
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.