Gossamer Forum
Home : Products : DBMan : Customization :

Couple of style changes

Quote Reply
Couple of style changes
Hi... I got 2 questions... I´m using the Short/Long Display version of Dbman..

I want to change the background colour of the dropdown menus to something other then the default white on the main search page..

Also is there an easy way to alternate the colour of the rows on the result page.. ie green, white, green, white.. and so on...

Help is appreciated... Justin

Quote Reply
Re: Couple of style changes In reply to
In Reply To:
I want to change the background colour of the dropdown menus to something other then the default white on the main search page..
You will have to use Javascript codes (and these codes only work in MIE 4.0 or above, and do not work in Netscape).

Some really good Javascript sites are the following:

http://www.javascripts.com
http://www.javascript.com

Good luck!

Regards,

Eliot Lee

Quote Reply
Re: Couple of style changes In reply to
For alternating your colors, this is the easiest way to do it.

Set up two variables in your .cfg file --


$row_color[0] = '#FFFFFF';
$row_color[1] = '#009000';


You can make these any color you want.

In sub html_view_success, make the following change

Code:

for (0 .. $numhits - 1) {
$color = !$color;
print qq|<tr bgcolor="$row_color[$color]">|;
&html_record (&array_to_hash($_, @hits));
print "</tr>";
++$rec_count;
}
JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Couple of style changes In reply to
Thanks for the replys..

After having looked at the source code on the homepage of javascript.com (because half way down the page is exactly how I wanted the dropdowns).. They seem to use CSS to do this..

May question now is where do I place the CLASS="select".. I tried in here, but got errors..

|; print &build_select_field ("DestinationTo", "$rec{'DestinationTo'}"); print qq|

Once again thanks for your help.. Justin


Quote Reply
Re: Couple of style changes In reply to
I'm trying to make some code I got from java scripts work here it is
no right click I using it under sub_search_results

<style type="text/css">
a {text-decoration:none; color:"#0000FF";}
A:active {text-decoration:none; color:"#FFFF00";}
A:hover {text-decoration:none; color:"#FFFF00";}
</style>
<script language="Javascript">
// Created by |{even
function buttoncheck(e) {
if (document.all && event.button==2) {
warning =
" !!! Warning !!!\n" +
"____________________\n" +
"\n" +
"Do you want my source \n" +
"code or do you want a \n" +
"picture from my home- \n" +
"page? \n" +
"\n" +
"Clik OK en send me an \n" +
"e-mail. and you also have \n" +
"to say the reason why \n" +
"you want that picture or \n" +
"source code \n" +
"\n" +
"I will try to answer \n" +
"you're email A.S.A.P \n" +
"woorden \n" +
"\n" +
"____________________\n"

var agree = confirm(warning);

if (agree !="0"){
top.location="mailto:kevintem@crosswinds.net";}
return false
}

if (document.layers && e.which==3) {
warning =
" !!! Warning !!!\n" +
"____________________\n" +
"\n" +
"Do you want my source \n" +
"code or do you want a \n" +
"picture from my home- \n" +
"page? \n" +
"\n" +
"Clik OK en send me an \n" +
"e-mail. and you also have \n" +
"to say the reason why \n" +
"you want that picture or \n" +
"source code \n" +
"\n" +
"I will try to answer \n" +
"you're email A.S.A.P \n" +
"woorden \n" +
"\n" +
"____________________\n"

var agree = confirm(warning);

if (agree !="0"){
top.location="mailto:kevintem\@crosswinds.net";}
return false}
}

if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);}
document.onmousedown=buttoncheck;
//-->
</script>

</head>

I put it between the <head></head> just under $header_info and I keep getting



Quote Reply
Re: Couple of style changes In reply to
damn, I wish I had thought of doing it that way first....

I alternate colours like so -

if((int($bnum / 2)) == ($bnum / 2)) {
$bgcol = "#E4E4E4";
} else {
$bgcol = "#FFFFFF";
}

$bnum++;

if the $bnum is an integer (ie, no decimal) then it will use the E4E4E4 colour, otherwise it will use FFFFFF.

Cheers

tom


Quote Reply
Re: Couple of style changes In reply to
That was sorta how I did it at first, too. But this seemed easier. Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Couple of style changes In reply to
In Reply To:
May question now is where do I place the CLASS="select".. I tried in here, but got errors..
You don't need to use a CLASS, you can just put:
<style type="text/css">
select {background-color:#ffff00;}
</style>


...under your <HEAD> tag.

Hope this helps

- Mark

PS: kellym, what do you keep getting? Smile

Astro-Boy!!
http://www.zip.com.au/~astroboy/