Adjusting In-text Carat Properties And Preventing Arrow Key Scrolling
Apr 12, 2010
For those without the time or patience to read the full post i have summarised a list of my issues, for the full description of the reasons behind them please read on.
Disabling the text cursor in a specific text field (not the mouse cursor but the one which is controlled by the keyboard inside the field)
Adjust the blink rate or the colour of a carat.
Anyone who has some in-depth knowledge about browser based games who would like to tell me about how they stop arrow keys from scrolling around the page.
I am currently constructing a page which displays a gallery of images and I have been trying to correct one final issue for some time now.
I have used a pair of buttons to navigate through the table cells in which the images are stored by using a getElementByTagName function and having the buttons adjust the index of the desired image. This works fine.
My issue arises from the fact that I also assigned the arrow keys using onkeydown and the relevant keycodes to call the same function so that the user can navigate the table via those keys. It all worked perfectly until I tested the page while it was zoomed in far enough that the browser scrollbars kicked in and with each arrow key press the page would scroll while also changing the selected image.
This in itself kind of highlighted the fact that I shouldn't really be hijacking default browser functions, so the logical solution was to a) provide the user with the option to enable arrow key navigation and b) prevent the document from scrolling about while this option is enabled.
So for:
a) I created a button which when pressed activates the onkeydown functions for the arrow keys and then changes into a button which will deactivate them again onclick.
b) was a hell of a lot more difficult to fix but in the end I found what I will call a "back door" method where I insert a read only text field, set it to match the background (which is conveniently black) so it is invisible, and force the document focus into the text field while the button is active. This disables the scrolling completely while the navigation is turned on and works perfectly... in firefox.
Someone extremely clever at Microsoft decided to code IE to make the text entry cursor contrast with whichever background is selected for the field, as a result I'm stuck with a blinking white carat next to my buttons which may be one of the most irritating things I have ever seen on a black background.
So again, I would be extremely happy if someone could suggest a solution to any of the following:
Disabling the text cursor in a specific text field (searched far and wide about this and the only answer anyone gets seems to be 'why bother using a text box at all' or 'removing my carat would make me extremely angry as a user' but usually because they dont specify why they want to hide it).
At least adjust the blink rate or the colour of the carat to make it less annoying or invisible (seen one example about the blink rate in JS but it seemed angled towards game coding and I couldnt get it to work on my page - tips appreciated).
An alternative or all-round better way to approach the navigation function issue as I'm not too pleased about having an invisible, barely functioning text field in the middle of my page - I've seen a few posts about setting up a div which acts as its own window but I haven't yet seen it working.
Anyone who has some in-depth knowledge about browser based games who would like to tell me about how they stop arrow keys from scrolling around the page.
One thing that I am fixed on keeping is that it is the arrow keys which navigate the table, I know an instant solution would be to use ASDW but I've been bashing away at this for so long that it's getting personal now.
I'm trying to get the cursor position to move to the end of the text within an editable iframe or div.I've been pointed to something called TextRange and have been reading up on it for days yet couldnt make sense of much (i'm still very new).what i'm trying to do is on a button click, the cursor will move to the end of the text in the iframe.
I searched a while on the web for this but i didn't find a solution that really worked. So is there a way how i can prevent IE9 from scrolling when i use the arrow keys?
im searching for a plugin/code example for text scrolling. I got some text in a <div> if text is longer than for example 300px it gets cut and is scrolling from start to end, stops for a second and then scrolls back, stops and all over, and if its not long enough than 300px then just displays normaly. Something similar to the Song name scrolling inin anyMP3 player.
I am using the tablesorter plugin and am experiencing the following problem:
Under several scenarios the up/down arrow icons will overlap with the text in a column's header. This occurs if the browser is resized so the table width is too narrow (e.g. plugin should force a min-width perhaps?).
More importantly, this will also occur when the text in a columns header is shorter than any of the values in the column the up/down icons overlap with the text in the column header.
I've attempted setting padding on the header columns but no success (probably because the up/down icons are set as background images and therefore have no impact on padding)
At the moment the plugin won't be usable for me since the arrorws overlap with the text in several columns.
how to add extra properties to html elements as I was storing data in html attributes. After looking at some others code including Raphael and this addEvent code. [URL] They seem to treat objects just like an array. obj[property] = value; This would have been extremely helpful to know previously as I have needed to be able to include variables in property names - but have resorted to making the whole thing a string and calling exec() on it.
Here is a little script I made and it just vertically scrolls text, but this is about the slowest I can make the text scroll, how could I get it to scroll slower witht his script? I can't increase the timeout else the eye can detect it.
HTML Code:
<script type='text/javascript'> var done = false; function scrollUp(x) { var box = document.getElementById('inner-scroll-box'); if (Math.abs(x) > box.scrollHeight) done = true; box.style.top = (x - 1) + 'px'
I want to add a sort of news service to my site. I've a number of messages, wich I want to be shown in a <marquee> tag. I've found a simple scrit that generates an random message (wich I've putted in an array) and the message is shown in an marquee tag. The problem is that for changing the message, a reload of the page is required. Isn't there a way to reload the message? Or every time the marquee tag shows a message, it will be a differrent message? Or perhaps not using the marquee tag, but another way to scroll text trough a page? ...
in a page I'm working on I have room for a div height not more than200px, however I need to fit in a text that requires 300px and I don'twant to show the scroll-bar on the right side so I'm looking for someways/plug-ins in order to scroll the text within the div. I'd like tbe able to scroll down, to scroll up and to stop the scrolling.
One of my clients has been using <marquee> to make some text scroll, but apparently it doesn't comply with W3C accessibility guidleines. I've been hunting around for a CSS/JavaScript code so we can lose the <marquee> command, but I can't find one. Do you know where I can get hold of one?
I just can't win with this site. Everytime I fix a problem, another arises.[URl].... If you view the site through IE, within the 'Upcoming Shows' i/frame, you will see some scrolling text (bottom to top).
The page that holds the code is www.mrbizness.com.au/updates.asp (the iframce pulls the code)
The problem is, it only seems to work in IE. When you view it in FF or Safari, instead of scrolling the text, it just displays the code. I've been awake for far too many hours, and consumed WAY too much PEPSI, so my eyes just aren't working anymore.
Anybody have any ideas why it would be doing this? I really want to get the site finished and be done with it...I think it's posessed.
I'm writing application that displays messages from users. This messages are kept in external XML file and every time user post a new message this XML document is appended.
What I want to do is to display all messages at the bottom of screen. Messages have to slide horizontally in one line. To do that I used this code:
The problem with that code is that at 1/3 length of text it starts from beginning and this is wrong. The text have to scroll to the very end and then start to scroll from beginning again.
Another thing, that I'm unable to deal with is refreshing/reloading the content from XML file. What I need to do is to check if XML was changed/appended and if it was then I have to add this added message to text that scrolls horizontally and view it at the end of horizontal text. I'm pretty sure I have to use Ajax here. Also, if text from XML file will be added to horizontal text page cannot refresh and start scrolling from beginning, but instead of that if have to append horizontal text and continue to scroll showing appended message at the end.
I came across this javascript scrolling text. My problem is :- I need to have a huge big long message/ messages, but after a certain point the scroller stops scrolling and goes back to the beginning so doesnt show every message that I want. I have tried to take out the <nobr> tags but that doesnt work. Is there anyone out there that can have a look at the code below and see if it can be modified to allow multiple lines of messages. Many thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin var l1 = 0; // left of ticker in pixel, or 0 to position relative var t1 = 0; // top of ticker in pixel, or 0 to position relative var w1 = 780; // width of ticker in pixel var ie = document.all ? true : false; var first = true; var l2 = l1 + w1; var l3 = l1 - l2; var l = l2; function tickinit() { if (ie) { if (l1 == 0 && t1 == 0) { pos = document.all['tickpos']; l1 = getLeft(pos); t1 = getTop(pos); } ticktext.style.posTop = t1; } else { if (l1 == 0 && t1 == 0) { pos = document.anchors['tickpos']; l1 = pos.x; t1 = pos.y; } document.ticktext.pageY = t1; } l2 = l1 + w1; l3 = l1 - l2; l = l2; setInterval('tick()', 10); } function getLeft(ll) { if (ll.offsetParent) return (ll.offsetLeft + getLeft(ll.offsetParent)); else return (ll.offsetLeft); } function getTop(ll) { if (ll.offsetParent) return (ll.offsetTop + getTop(ll.offsetParent)); else return (ll.offsetTop); } function tick() { l = l - 1; if (l < l3) l = l2; cl = l1 - l; cr = l2 - l; if (ie) { ticktext.style.posLeft = l; ticktext.style.posTop = t1; ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)"; if (first) ticktext.style.visibility = "visible"; } else { document.ticktext.pageX = l; document.ticktext.clip.left = cl; document.ticktext.clip.right = cr; if (first) document.ticktext.visibility = "show"; } first = false; } // End --> </script> </head>
So I am new to JQuery and Javascript in general. I have a MasterPage with a content placeholder specifically for my JQuery script tags on my content pages.
I have written a JS search function. I want it to work with IE, Firefox, Opera and Windows Safari. At this point it is working in all four of these browsers except for one feature: if the word I'm searching for is at the bottom of the textarea (not in the visible text) then the search function will not scroll the text up so that the find is visible.
I should quickly say that this does work in IE but not in the other three browsers. I'm at a loss as to how to get the textarea to scroll the found word into view in FF, Opera and Safari.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Here is an example of a scrolling window and the codes about it:
[Code]...
I have some questions about it:
a)Can i move the text from top to the buttom?(which is the opposite from what it moves now). b)How can i make the text to move nonstop?In other words when it stops to start again. c)I have used the obj.style.left=pos in order to make the text move from left to right but i want it to move all horizontally in one line only.How could i do that?
I'm trying to find a script that will scroll text past fixed position sandbag divs.
I want the text to flow around an image as it scrolls.
It's easy to do the wrap around the image part. I can't seem to find anything that will continue wrapping the content of your site around the fixed background as you scroll though.
I inherited a site that has jscript and html content. The site frame (top and left nav) are controlled by the jscript file. Most all of the content that is displayed when links or topics are selected is placed in the center of the page. I need to put some scrolling text in one of the top frame blocks, (the section that is java script file).
function buildMenus(){ var headerString = ""; var leftnavString = ""; var footerString = "";
[code]....
I have a couple of jscripts that do the scrolling I want, I just need to know how to insert it in the above section.
I am looking at a client’s site that has a scrolling text bar at the bottom of the page for latest news. I have been asked to recommend whether they keep the scrolling text as a java applet or whether they make it dhtml with Javascript to make it scroll.
To be honest, I’m not sure whether there really is an important difference, in terms of download time, likelihood of working (if client browsers are better enabled for one verses the other), or whether there are any other reasons one should be used over the other.
jQuery - Scrolling browser Window. I have two demos of scrolling page content with jQuery.
This one - [url] is scrolling the contents inside a container and it works as I wanted on Mac/PC
Code:
I need the same effect as above but I need to scroll the whole browser window.
I have a demo here - [url]
Code:
Problem here is on the Mac the transition are jumpy and it seems to flash the first yellow div before sliding up or down. Testing on a PC it will slide down but won't slide up. How can I get the whole browser window to slide up and down with a smooth transition.