|
David O`Neil wrote:
That will only repeat the background IN THE AREAS WHERE TEXT APPEARS. For this reason it won't work if you want the header to automatically expand itself to the right edge of the page. (If your line of text is: "My Text", and it is displayed in 10pt, the background will only be about 1" in width, and will end right after the final 't'.)
Well, that depends on what type of element you have... If you show me the code that is not working I will fix it for you...
About the path to stuff...
Aha, you want the the path to be relative but varying...
Ok.. here is what i sugest...
Add a container DIV to your page holding the menu.
Create a Javascritpt function that crates the meny...
Load the script in the page tag (onLoad="buildMenu();")
Something like this...
<br />
<style><br />
.menuItem { width: 100px; clear: both; float: left; BACKGROUND-COLOR: #FFF; border: #CCF; border: none; margin: 1px;}<br />
.menuMouseOver { width: 100px; clear: both; float: left; BACKGROUND-COLOR: #CCC; border: solid 1px #CCF; margin: 0; }<br />
.menuKeyDown { width: 100px; clear: both; float: left; BACKGROUND-COLOR: #444; border: solid 1px #CCF; margin: 0;}<br />
#menu { height: 200px; }<br />
</style> <br />
<script><br />
function initNavigation(sElementId, iLevel) {<br />
if (!document.getElementById) return;<br />
<br />
var sDir = '';<br />
var i;<br />
for (i=0; i<iLevel; i++) {<br />
sDir += '../';<br />
}<br />
var arrNav = new Array();<br />
arrNav[arrNav.length] = ['Main', sDir + './Page1.htm'];<br />
arrNav[arrNav.length] = ['Medit', sDir + './medit/Page1.htm'];<br />
<br />
var elm = document.getElementById(sElementId);<br />
for (i=0; i<arrNav.length; i++) {<br />
var r;<br />
r = document.createElement('span');<br />
r.className='menuItem';<br />
r.innerHTML = '<a href=\''+arrNav[i][1]+'\'>'+arrNav[i][0]+'</a>';<br />
r.onmouseover = function () { this.className = 'menuMouseOver'; }<br />
r.onmouseout = function () { this.className = 'menuItem'; }<br />
r.onmousedown = function () { this.className = 'menuKeyDown'; }<br />
r.onclick = function () { this.className = 'menuKeyDown'; document.location.href = this.childNodes[0].href; }<br />
elm.insertBefore(r,null);<br />
}<br />
}<br />
</script><br />
</HEAD><br />
<body onload="initNavigation('menu', 1)" ><br />
<form id=Form1 method=post runat="server"><br />
<div id="menuContainer"></div><br />
Level specifyes how deep the page is.
By the way...
I think that you realy shouldn't use absoulte path's to files and images. Instead use relative paths.
/M
|
|
|
|
|
I finally got the image to repeat, thanks to your prompting. I don't know what I was doing wrong earlier.
But just getting it to repeat doesn't solve the root problem, which is: "How would you create the purple border effect used on www.randommonkeyworks.com using only css elements?"
As for the paths: that is some great code you've posted, although I haven't tested it. (A 'for' loop end was sucked up by a "<".) But I don't see that it is any better than my solution, and it even appears that it will make loading pages more innefficient than my method, as there is a lot more computation that must take place.
And as for your belief that I should use relative paths: I would tend to agree, except that they get in the way of creating a site that is not brittle. You can see what I did to place the header and sidebar across all of the pages to my site, if you want. Here's a page I wrote up a while ago, briefly skimming the details. Of course, my css skills have improved since then, as well as some of my other skills, but I still can not see a simpler and easier to change method to accomplish what I have accomplished.
David
|
|
|
|
|
Hi...
There are some differences between your code and mine...
Mine is general, you don't have to maintain a root-path.
And it is a little easier to add events and styles to the elements in my code.
About the page load, you don't need to worry; it is a lot faster then the web browsers are rendering the page.
However… I have looked into making your page not using tables. Well it is possible but not with the exact look... There are differences between how tables (and table-cells) behaves and how div and span elements behave.
Here are some of them.
A table cell always fills out the rest of the cell if the table has a size and the rest of the cells have size. That is currently not possible using CSS. (Quite annoying actually).
It is not possible to align a span or div between each other in the way cells are aligned to each other.
A span or div does not change size like a table and cells changes size.
So, if you want this very dynamic behavior of changing size you are stuck to table.
However, I have made a little recoding of your page. You will find it here:
http://www.olgerfelt.se/MonkeyCode/Monkey.zip[^]
Note also that you have to replace the corner image to get the look you want.
/Mattias
|
|
|
|
|
Hi, again... corrected some small fuzzes... new version is downloadable...
/M
|
|
|
|
|
First, thank you, thank you, thank you, for taking the time to work on this and showing me something new. I really appreciate it.
I have been looking at it, and working with your first example, and just now looked at your second example. I'm trying to work out more futzes, and will get back with you on the results shortly. One thing I have noticed is that on your revision the corner jpg does not show up in Firefox, although I see Explorer presents yours very nicely. I'll explore this more deeply in a bit.
David
|
|
|
|
|
David O`Neil wrote:
One thing I have noticed is that on your revision the corner jpg does not show up in Firefox, although I see Explorer presents yours very nicely.
You can count with that IE is doing wrong and FF is correct...
/M
|
|
|
|
|
David O`Neil wrote:
One thing I have noticed is that on your revision the corner jpg does not show up in Firefox, although I see Explorer presents yours very nicely.
You can count with that IE is doing wrong and FF is correct...
/M
|
|
|
|
|
This is what I got so far. My back hurts, my stomach is upset, and I'm otherwise very tired - all from working on this problem too hard. What I have works in Firefox, but not quite right in IE... Grrrrrr..... I'm going to take a nap!
Note that when the page is made narrow, the top words stay where you would expect them to stay. That was a big issue I had with part of your approach that absolute positioning seemed to fix.
David
|
|
|
|
|
Well,... almost. I've updated that last link again, but I am getting to issues that I can't figure out how to overcome.
The bottom footer: I have left it tucked inside the ContentContainer division, because if I don't, I can't get it even close to being below the ContentContainer material if the page becomes so long that the right scrollbar appears.
Also, my best efforts (the way I left it) resulted in the page working beautifully in Firefox, but the bottom scrollbar activates itself in IE, even though there is _nothing_ to the right of the screen! I believe this is because the ContentContainer's left margin is 120px, combined with a width of 100%. This also makes it so that the screen content doesn't wrap properly in IE (but it works wonderfully in Firefox, as I said).
Any ideas how to place the footer below the ContentContainer? Any idea how to get rid of the bottom scrollbar in IE without blowing everything else up?
I would love to have my site as clean as possible, but I'm beginning to suspect that it is just too much work to get this complicated of a style going.
Thanks,
David
(ps - The more I look at your JavaScript, the more I like it. Thanks.)
(pps - Even though Firefox renders it nicely, it does strange things when you highlight text by dragging the mouse over it. IE is much more predictable in that regard.)
|
|
|
|
|
12:32 am, CST: I'm giving up? Reposted best code so far in order to accomplish footer. Used a table. (Attempted it using only divs many, many times.) Gnnn. In addition, the solution appears different between Firefox and IE. In this case, I believe IE is correct for once.
David
|
|
|
|
|
hi, I am too tired to understand your first problem now, but I understand second one perfectly - I've run exactly to same problem. I've solved it with full path. And yes, it's ASP.NET solution, so I have base URI in config file. I think that best solution would be if HTML base tag could be applied localy. That's not the case, and convince W3C would take some time Nah.. I've just looked at your JS - basicaly same idea as mine.
btw you can use some ideas from http://dnhsoftware.org/[^], if you like the layout. Not a single misused table there!
David
|
|
|
|
|
i have uploaled my exe on the web server of our private net. now i want that whenever someone tries to download my exe, a pop-up box should come up which will ask for the license key. once the licence key is validated, only then the download should start. how do i implement it?
Secondly since the exe will be hosted on intranet, so whenever someone tries to download my exe, i need to know the IP address of the system which is trying to download it, check whether its a valid internal address and only then ask for licence input. how do i implement it?
|
|
|
|
|
Hi:
Regarding your first query, you can implement a login like script and only after validation of license, you can Response.Redirect to the EXE or Stream the EXE with appropriate content-type set.
Regarding your second query, you can configure at the server level instead of validation of network IPs in ASP since it would be processor intensive operation.
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
i think i can handle the first part of the query.
now, let me re-phrase my second requirement. i want that everytime my EXE starts it should first validate with the server. how do i do? any sample code?
|
|
|
|
|
Basically in the client workstation, each time the EXE is launched you want to check with the server.
Cool. You can have a Web Service exposed through your webserver and your application can contact the same.
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
You have written:
You can have a Web Service exposed through your webserver and your application can contact the same
But how do i do? please help out. some sample code? or just some idea how will my application contact the server? what sort of communication is needed?
|
|
|
|
|
well, i tried to put an executable on a web page so that it can be downloaded.
the code was CLICK HERE TO DOWNLOAD THE EXE FILE
The code worked when i put the web page on apache web server. but its simply not working for IIS. can anyone point me out where the problem is?
|
|
|
|
|
Have you tried putting it in a zip ? That way it will be smaller, for a start.
Why is it not working ( that is, what is it not doing ) ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
ya, its in zipped format.
by not working i mean that the code < a href ="myexe/Setup.exe" > < b > CLICK HERE TO
DOWNLOAD CAIR PERSONAL FIREWALL < /b >< /a > is working fine when i put this web page on a apache web server.(its downloading the file). but when i put this web page on IIS server, it does not download. its tries and finally times out
|
|
|
|
|
Regarding the timeout, ensure that the IIS does not try executing it. Execute permissions should be turned off otherwise, IIS will try to execute the DLL/EXE and similar types.
I think as goes the previous discussion, try with a zipped version, to save bandwidth over the network pipe.
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
thanks.. i had given execute permission for EXE. i have configured it properly and its running now
|
|
|
|
|
Go to the MIME headers in the IIS Manager of the website and add .exe files to be downloaded. This should do the trick
|
|
|
|
|
HELP!! I need a HTML code that I can use on Yahoo Email for putting a Picture(.gif) in the Signature. Any Help would be GREATLY Appreciated
|
|
|
|
|
If a standard img tag won't work, then nothing will.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
<img src="Your Path"/>
|
|
|
|