Custom Scrollbar |
![]() ![]() |
Custom Scrollbar |
![]()
Post
#1
|
|
![]() Bardic Nation ![]() ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 1,113 Joined: Aug 2004 Member No: 38,059 ![]() |
I seem to have stumped all the xanga help people that are on at 5:30 once again in my 3 days.
Ok i tried to put a custom scroll on my boxed xanga which is a div and lets say the div's id is xanga226892, what the hell did i do wrong? this thing took me forever. this code was all in the custom header. the pic links are bad i know but it shouldnt effect the whole thing. when i hover over the buttons it says "object expected". As far as i can tell all the objects are in place. CODE <!-- begin code provided by createblog.com -->
<script type="javascript"> var scrollPeriod = 100; var scrolling = false; function getStyleById(id, property) { var element = document.getElementById(id); var style =; if ((style != "") && (style != null)) { return style; } if (element.currentStyle) { style =; if ((style != "") && (style != null)) { return style; } } return null; } function setStyleById(id, property, value) { var element = document.getElementById(id); element.style[property] = value; } // FIXME: this should be moved to a utility library function getElementHeight(element) { var height = null; if (document.defaultView && document.defaultView.getComputedStyle) { var computedStyle = document.defaultView.getComputedStyle(element, ""); height = computedStyle.getPropertyValue("height"); } if ((height == null) || (height.length < 1)) { height = element.offsetHeight; } return parseInt(height); } function scroll(containerId, contentId, direction, amount) { var containerDiv = document.getElementById(containerId); var contentDiv = document.getElementById(contentId); var topOffset = parseInt(getStyleById(contentId, 'top')); if (isNaN(topOffset)) { topOffset = 0; } var containerHeight = getElementHeight(containerDiv); var contentHeight = getElementHeight(contentDiv); var newOffset; if (direction == 'top') { newOffset = 0; } else if (direction == 'bottom') { newOffset = containerHeight - contentHeight; } else if (direction == 'up') { newOffset = topOffset + amount; } else if (direction == 'down') { newOffset = topOffset - amount; } else if (direction == 'to') { newOffset = 0 - amount; } if (newOffset > 0) { newOffset = 0; } if ((containerHeight - newOffset) > contentHeight) { newOffset = containerHeight - contentHeight; } contentDiv.style['top'] = newOffset; return true; } function scrollUp(containerId, contentId) { return scroll(containerId, contentId, 'up'); } function scrollDown(containerId, contentId) { return scroll(containerId, contentId, 'down'); } function scrollToTop(containerId, contentId) { return scroll(containerId, contentId, 'top'); } function scrollToBottom(containerId, contentId) { return scroll(containerId, contentId, 'bottom'); } function scrollContinuous(containerId, contentId, direction, amount) { if (scrolling) { scroll(containerId, contentId, direction, amount); window.setTimeout("scrollContinuous('" + containerId + "', '" + contentId + "', '" + direction + "', " + amount + ");", scrollPeriod); } } function scrollStart(containerId, contentId, direction, amount) { scrolling = true; scrollContinuous(containerId, contentId, direction, amount); } function scrollStop() { scrolling = false; } function scrollSetup(containerId, contentId, controlsId) { var container = document.getElementById(containerId); var content = document.getElementById(contentId); var controls = document.getElementById(controlsId); var containerHeight = getElementHeight(container); var contentHeight = getElementHeight(content); if (contentHeight <= containerHeight) { controls.style['visibility'] = 'hidden'; } } </script> <script language="javascript"> function onBodyLoad() { self.focus(); scrollSetup('xanga226892', 'none'); scrollSetup('xanga226892', 'none'); } </script> <div id="none" style="position:absolute;"> <a href="#" onmouseover="scrollStart('xanga226892', 'up', 10); return false;" onmouseout="scrollStop(); return false;"><img src="/sitewide/assets/img/buttons/up.gif" onclick="return false;" alt="" border="0"></a> <a href="#" onmouseover="scrollStart('xanga226892', 'down', 10); return false;" onmouseout="scrollStop(); return false;" onmouseout="scrollStop();" onclick="return false;"><img src="/sitewide/assets/img/buttons/down.gif" alt="" border="0"></a> </div> <!-- end code provided by createblog.com --> |
|
|
![]()
Post
#2
|
|
![]() I HAVE YOUR IP ![]() ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 1,429 Joined: Feb 2004 Member No: 2,745 ![]() |
CODE <!-- begin code provided by createblog.com --> <div id="none" style="position:absolute;"> <!-- end code provided by createblog.com --> ^-- there lays your problem, xanga doesnt allow position absolute. |
|
|
![]()
Post
#3
|
|
![]() Bardic Nation ![]() ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 1,113 Joined: Aug 2004 Member No: 38,059 ![]() |
ok thanx, btw position absolute is allowed in entries
|
|
|
![]()
Post
#4
|
|
![]() Bardic Nation ![]() ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 1,113 Joined: Aug 2004 Member No: 38,059 ![]() |
no its the next line down, it is having a problem with the link tags.
this is programming chat, its supposed to be more advanced than xanga help. Come on guys where are you? |
|
|
![]() ![]() |