473,614 Members | 2,352 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 1775
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
2576
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
6380
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
2203
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
1727
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
1720
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
8198
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
1391
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
5352
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
2042
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
8198
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
8142
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8591
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...
0
8444
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
7115
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...
0
4058
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...
0
4138
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2575
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.