Tip

Non-scrolling previous/next buttons

Previous(@DbCommand("Domino"; "ViewPreviousPage")) and Next(@DbCommand("Domino"; "ViewNextPage")) buttons come handy when we need to limit the number of documents in an embedded view to be displayed on a single page. But then, shouldn't we stop scrolling of these buttons so that we could go to the next or previous screens anytime we want, without any scrolling up or down?


In your $$ViewTemplate form(with your embedded view) put the following code

<div id=waterMark style="POSITION: absolute; left:0px; top:30px; height:100px; width:780px; clip:rect(0,880,200,0)">

<!--Pass the above code through HTML-->

<!--Put your next and previous buttons here as hotspots preferably in a table and don't pass them through HTML-->

<!--Pass the code below through HTML-->
</div>

<SCRIPT language=JavaScript1.2>
<!--
markW = 122;       // pixels wide
markH = 403;       // pixels high
markRefresh = 20; // milliseconds

// set common object reference
if (!document.all) document.all = document;
if (!document.all.waterMark.style) document.all.waterMark.style = 
document.all.waterMark;

wMark = document.all.waterMark.style;
wMark.width = markW;
wMark.height = markH;
navDOM = window.innerHeight; // Nav DOM flag
 
function setVals() {
 barW = 0; // scrollbar compensation for PC Nav
 barH = 0;
 if (navDOM) {
  if (document.height > innerHeight) barW = 20;
  if (document.width > innerWidth) barH = 20;
  } else {
  innerWidth = document.body.clientWidth;
  innerHeight = document.body.clientHeight;
  }

   posX = 10;
   posY = 10;
   
 }

function wRefresh() {
 wMark.left = posX + (navDOM?pageXOffset:document.body.scrollLeft);
 wMark.top = posY + (navDOM?pageYOffset:document.body.scrollTop);
 }

function markMe() {
        if (screen.width > 640 ) {

             
    setVals();
    window.onresize=setVals;
    markID = setInterval ("wRefresh()",markRefresh);
    }    
 }

    window.onload=markMe; // safety for Mac IE4.5

//-->
</SCRIPT> 

<!--Embedd your view here-->

And you as scroll through the documents displayed in the embedded view, you can at any point of time access the next/previos button, because they don't scroll!!!!!

This was first published in October 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.