Center Horizontal Scroll Bar
Mar 5, 2005
This works for me with IE 6.0
<html>
<body onload="scrollBy((document.body['scrollWidth'] - 1010) / 2, 0)">
<table width="500" border="1" align="center">
<tr>
<td align="center">1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 | 9 9 9 9 9 8 8 8 8 8 7 7 7 7 7 6 6 6 6 6 5 5 5 5 5 4 4 4 4 4 3 3 3 3 3 2 2 2 2 2 1 1 1 1 1</td></td>
</tr>
</table>
</body>
</html>
The numbers in the table are just to keep track of how centered the horizontal scroll bar is. Mess around with the table width; Change it to 100 or to 10000. The numbers stay aligned perfectly.
Anyone have any problems with different browsers?
View 2 Replies
ADVERTISEMENT
Feb 24, 2009
i have 1 div with scrollbars and another div with a table inside. when user scroll horizontal bar in div1 i want application to scroll the table header from the same amount of pixels and in the same direction. i did not find anything under jQuery about that.. :-(
1. how can i detect in which direction the scroll is done (to the right, or to the left) ?
2. how can i determine how many pixels this scrolling is about ?
3. how to scroll the table header (table tag or th tag) from the same amount of point ?
i found just scrollLeft for now and i'm not successful to use it
View 1 Replies
View Related
Sep 23, 2010
i'm wondering unknow on making element in html center to browser 'screen.
View 3 Replies
View Related
Aug 26, 2011
There is a bug that I'm working on which involves a page that contains a portlet with a fixed width and horizontal scroll bar - the scroll bar does not appear to work in IE 9, but all other browsers seem to be fine. For simplicity I reduced the page to the following HTML snippet containing the style and javascript.
This HTML document displays a scrollable div with some text and a section that is right aligned which is updated via javascript so that it will continually displayed as right aligned. And yes, there are many other ways to accomplish this using pure CSS, but what I don't understand is this - why does updating the style.left of some child element stop the scroll from happening? It just doesn't make sense to me. Also... the reply "IE is just weird/buggy..." is not what I'm looking for
[Code]..
View 5 Replies
View Related
Jan 15, 2011
I'm trying to get horizontal scroll to work on my website. Basically view click on the arrow images and the images would scroll left and right. However I can't seem to get it to work correctly. What am I doing wrong? So very confused right now.... Website in question: [URL]
View 6 Replies
View Related
May 10, 2006
I need to present information in a horizontal format so that someone can look across a page and identify an objective with an activity just like an Excel spreadsheet (but it needs to be database enabled)
It would be useful to be able to 'freeze' the objective column and scroll the other columns horizontally. However I am not sure how to do this. Should I use JS, CSS or iframes. Can anyone suggest how this is done?
View 1 Replies
View Related
May 16, 2010
I want the horizontal scroll to be hidden and the vertical scroll shown, how do i do that?
View 2 Replies
View Related
Jul 11, 2011
How to find a horizontal scroll menu plugins ?
View 2 Replies
View Related
Jan 27, 2011
I've been desperately searching for a horizontal scroll plugin for my clients site but there always seems to be something that prevents the plugin from working with the layout of the site. Here's what I'm looking for:
-smooth horizontal scroll with no horizontal scroll bar
-scrolls div container which has nested divs (no width/height restrictions and only one container viewable at any given time)
-external navigation, fixed navigation preferred
-navigation should be text i.e. home / about / contact etc.
-links still work if JS is turned off
View 2 Replies
View Related
Apr 19, 2010
I have a page on my website where I put an iframe and display inside it another website, something like this:
<iframe frameborder="0" height="100%" scrolling="yes" src="http://www.another-website.com/" style="overflow: scroll; min-height: 600px;" width="100%"></iframe>
My problem is that my page have a fixed width of for example 800px which the iframe width is 100% of this width, but some external websites I put inside the iframe have a wider fixed width than 600, for example if the external website have the width of 1000px then my iframe will have a horizontal scroll. I don't want the horizontal scroll to appear and at the same time I want the iframe to show the whole width of the external website. Is there a way that I can control the width of the external website and make it 100% of the width of my iframe instead of their fixed 1000px for example? I don't think I can but I thought I would ask anyways maybe it's possible!
View 3 Replies
View Related
May 11, 2004
if there was a script to disable only the horizontal scroll bar in a browser window on a site with frames?
View 7 Replies
View Related
Feb 10, 2011
I'm trying to add a fade-in and fade-out effect to the default scrollHorz transition.The code I'm currently using is as follows :
$('.Gallery').cycle({
speed: 1000,
timeout: 3500,
[code]....
View 2 Replies
View Related
Jun 28, 2011
How is it possible to slide right/left within a horizontal scroll window for as long as the mouse-down action is triggered (preferably with jQuery)? Couldn't find any examples // functions to do that..
View 1 Replies
View Related
Sep 25, 2009
how to make an image/text to scroll as the user scroll the page also? for example if the user scrolls down image/text also scrolls down and when the user scrolls up image/text also scrolls up..
View 6 Replies
View Related
Jan 3, 2007
Is there a way in which we can disable the history scroll functionality in IE? Basically disable the SHIFT key + Mouse Scroll combination.
View 1 Replies
View Related
Jun 13, 2006
Does anyone know of a script that makes a div tag and its contents scroll down the page automatically when you scroll?
View 2 Replies
View Related
Jul 23, 2005
I am trying to make a prompt that will ask the user for some input...
If I just use var input = prompt("dafa") everything works fine but the
box is put in the top left corner of the window. I need it to be
centered so... I was doing some research on the net (never really used
much JavaScript before) and was reading the only way to do this is by
making your own custom prompt. In my attempts of doing so I came up
with this code below. The problem I am having now is that when
onMaxLoad_Click() occurs the prompt appears for a split second and then
it goes back to being hidden. Code:
View 7 Replies
View Related
Jul 23, 2005
Suppose one wants to write some text in the web page which needs to be
center aligned, then how to do it?
The command for writing some text is as follows if I am correct:
document.write('This is some text');
What needs to be done to write the above text with center alignment? Can
some one give me the syntax?
View 2 Replies
View Related
Mar 3, 2006
I want to center a new window that opens. Current code:
<a href="javascript:void(0)" onclick="window.open('./dilbert.html','Dilbert','height=250, width=800,scrollbars=no')">Dilbert</a>
How can I center the new window this creates?
View 7 Replies
View Related
Jan 17, 2003
I am using the perfect pop up window script from this site and I want to edit it so the window pops up in the center of the screen om all screen resoultions. At the moment the pop up in some case is half off the screen which is annoying.
var newWin = null;function popUp(strURL, strType, strHeight, strWidth) { if (newWin != null && !newWin.closed) newWin.close(); var strOptions=""; if (strType=="console") strOptions="resizable,scrollbars,height="+ strHeight+",width="+strWidth; if (strType=="fixed") strOptions="status,height,scrollbars,="+ strHeight+",width="+strWidth; if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,"+ "resizable,location,height="+ strHeight+",width="+strWidth; newWin = window.open(strURL, 'newWin', strOptions); newWin.focus();}
><a href="link.htm" onclick="popUp(this.href,'console',500,300);return false;" target="_blank">
View 3 Replies
View Related
Jul 20, 2005
Can somoene give me an example of how to center a div, according to it's
image size... I am using different images, and so I have to resize it in a
functino according to the image's size. So I use a h and w vairable that
give me the height and width of the current image, but I can't seem to come
up with a simple freaking formula to center the image vertically and
horozontally.
fnFullView = function () {
var h
var w
var _tempImg = new Image()
_tempImg. () {
_tempImg.src = this.src
h = this.height
w = this.width
}
_tempImg.src = arPhotolog[currIndex].full
_picGalImage.resizeTo(w,h)
_picGalImage.swapImage(_tempImg.src)
_picGalImage.show()
}
This is the function I am working on, but it really doesn't matter how I do
it.
View 4 Replies
View Related
Jul 26, 2011
I want to get some idea of what methods there are to center a div element.If you know a cool method please show us how it's done using this jsfiddle dummy to start
View 16 Replies
View Related
Sep 30, 2010
I want to center a javascript and CSS horizontal dropdown menu, How do I centre the bar I am using the stylesheet. [url]
View 3 Replies
View Related
Oct 16, 2006
I need to center (horizontally as well as vertically) a div on screen. It will be in front of everything else on the page and will include dynamic HTML content. (radio buttons, text input, etc.) Essentially it's an in-page popup. (Don't call me evil, this is for a game I'm making.) So far I can get FF to center it with this code:
function ShowBox(str,MsgBox){
MsgBox.innerHTML = str;
var style = gStyle(MsgBox,null);
var h = parseFloat(style.height);
var w = parseFloat(style.width);
MsgBox.style.left = (gWinWidth() - w) / 2 + "px";
MsgBox.style.top = (gWinHeight() - h) / 2 + "px";
MsgBox.style.display = "block";
}
Where gStyle is a cross-browser alias for getComputedStyle, str is the message I want displayed in the box, and MsgBox is the div that acts as the popup. Code:
View 2 Replies
View Related
Jun 8, 2010
I'm working on pop up screen which has protected void btnAdd_Click(object sender, EventArgs e){
btnAdd.Attributes.Add("onclick", "window.open('add_Employee.aspx','mywindow','menubar=1,top=300,left=300,resizable=1,width=400,height=250'); return false; ");
}
but i want the pop to be in middle of the screen in all screen resolutions
View 1 Replies
View Related
Oct 14, 2010
I used the below code, but it seems not correct.I want cut the around of photo, and show only the center 200*200px, how to modify?
HTML Code:
<div style="width:200px;height:200px;overflow:hidden;background-color:#000;"><img src="http://www.chlorischile.cl/alternanthera/foto6inflorescencia.jpg" width="200"
onload="this.style.backgroundPosition=(200-image.width)/2+'px';this.style.backgroundPosition=(200-image.width)/2+'px';no-repeat;" /></div>
View 2 Replies
View Related