PDA

View Full Version : Hide Browser Scroll Bar?



NeoMorph
September 27th, 2007, 02:13 PM
Is there any way I can hide the right hand scroll bar in the browser object? The webpage I'm using is a fixed size and there isn't a scroll button visible but the background for the scroller is spoiling the panel.

I even tried creating a button to appear over the scroller but the browser object shoots to the front when you run the ccf.

mhwlng
September 27th, 2007, 11:04 PM
just use in your web page:

...
<body scroll="no">
...
</body>
...

Marcel

dsmes
September 28th, 2007, 01:26 AM
I seem to remember Marcel teaching me that trick as well! Another thing you may find useful is to get rid of the margin around the perimeter of your html page. Here is how I start building web pages in Lua-
htm_start = '<html><head></head><body bgcolor="#666699" scroll="no" bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0">'Note the use of single quotes around the entire text string. This allows you to use double quotes within the text string w/o delimiting them with a \ character. If you used all double quotes, it would look like-
htm_start = "<html><head></head><body bgcolor=\"#848C94\" scroll=\"no\" bottommargin=\"0\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">"By the way, the background color (bgcolor=...) is optional. You can also use double square brackets to delimit a literal string which is nice if your code runs for several lines.
htm_start = [[
<html>
<head>
</head>
<body bgcolor="#3467CD" style="margin:0px;" scroll="no" >
]]Note also the single style statement to get rid of the margins.
Another useful trick when you have, say, a radar image that is bigger than the frame opening in your CCF is to move the image in the web page so the area of interest is centered-
radarstring = htm_start..'<div style="position:absolute; top:-18px; left:80px">'Again note the single vs double quotes and that the image offsets can be positive or negative.
Since I'm on a roll, let's complete the example by adding an animated GIF and sending it to NR (from a Lua function)-
local Animate_url = "http://weather.unisys.com/satellite/sat_ir_rad_loop-12.gif"
radarstring = radarstring.."<img src="..Animate_url..">"
radarstring = radarstring.."</body></html>"
NetRemote.ExecuteAction(-2,1,33,'Animate,'..radarstring)...where "Animate" is the web browser frame name on your CCF page.
Have fun!

mhwlng
September 28th, 2007, 01:35 AM
also note that instead of feeding an html string to the web browser via executeaction....

I usually use the built-in web server with .lhtml 'templates' in the httpd directory, that can easily be edited and don't require a restart of NR (unlike when you are editing lua)...

for example : my .lhtml file that displays artist biography looks like :



<html>
<head>
<TITLE>bios</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
body {
color:#00000;
background-color:#5393AA;
scrollbar-face-color: #848c94;
scrollbar-arrow-color: #ffffff;
font-family:Verdana,Arial,Helvetica,sans-serif,"MS sans serif";
}
</style>
</head>
<body scroll="auto" style="margin: 0px 0px 0px 0px;" >
<p style="cursor:default;color:#ffffff;font-size:14px;">
<% return Marcel.mediacenter.bios %>
</p>
</body>
</html>



and I call it like :



NetRemote.ExecuteAction(-2,1,32,'WEBNOWPLAYINGTRAYL,http://127.0.0.1:'..NetRemote.GetVariable('WEB.SERVER.POR T')..'/marcel/biography.lhtml');



Marcel

NeoMorph
September 28th, 2007, 02:48 AM
Cheers... It's the simplest things I keep forgetting...

Would you believe I've coded up numerous websites in the past but I haven't done any html coding in ages and as the saying goes "use it or lose it" is very apt in my situation.

Well now I have that sorted I just need to get Ron to fix the web browser's bad habit of double submitting... The XBMC web server page works fine in IE and when you select a song for the playlist it adds it to the playlist fine... The same page in NR browser and you get the song added twice.