473,847 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax Updatepanel and Manual scroller

1 New Member
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.offse tHeight 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 1782
kenobewan
4,871 Recognized Expert Specialist
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
2586
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 container. I am not sure that I configured the Triggers correct, but the behaviour is OK. When I click the linkbuttons they switch between two sets of search controls. When I click the search buttons they reload the display panel. BUT .... if the...
4
6397
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
2216
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 the form load event. Why should it fire when I put a button in a update panel? Is this necessary and is only the other controls related to the update panel send back? Or the whole page (If this is true I really do not get it). But please answer...
0
1740
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 ItemTemplate in the repeater has an Label control that is showing ArticleName and an UpdatePanel. The UpdatePanel contains another Repeater. I also have a button above the repeater. Each UpdatePanel has an AsyncPostBackTrigger setup to my Button...
7
1733
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 I have a button. In my buttons click event in the cs / code behind, I have a loop that just inserts items in the listbox. My question is, once I click the button and the loop begins, how do I get it to update the listbox? Does this make since?...
1
8207
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 behaviour: it's a webform with some VB code-behind, you shoud create a new AJAX-enabled application and past the following code. (DEFAULT.ASPX) <%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %> <html...
1
1400
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 where ajax is used, but not with UpdatePanel. (without extensions) Would I be able to use UpdatePanel tag along with the current implementation? Or there is a contradiction in older and newer ajax styles? It's all .NET 2.0 environment. Thanks,
4
5365
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 text field which causes the Autocomplete extender to display 10 like items, after the users selects an item (which is a key in the database) I want the application to go to the database retrieve a record and populate the fields.
1
2062
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 working. Any ideas? <%@ Page Language="VB" AutoEventWireup="false" CodeFile="default-ajax.aspx.vb" Inherits="pages_verify_groups_Default" Debug="true" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
0
9886
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10983
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10647
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10706
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10338
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9482
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7882
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7056
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5719
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.