SSI Nav Bar But Page Name Cell A Different Colour?

Jul 20, 2005

My website formatting knowledge is mostly HTML; I know hardly any
Javascript. Recently I created a site with a nav bar in table format across
the top of the page, and I made the background colour of the cell with the
name of the page that the reader was on a different shade, like this:

Home | This | That | Other | Etc.

If you were on "Other" page, for example, the background colour of the
"Other" cell was a different shade from the others. I created this by
altering the code on each page.

This site was hosted with a web host that has SSI, and the nav bar became
the same file for every page, so we lost this minor navigation aid. Someone
mentioned that the same effect (a different colour or shade for the cell
with the page name) could be achieved with Javascript, but since I don't
know Javascript and we'd run out of time, we didn't do it.

Now I'd like to have this different colour for the page name cell at another
site using SSI for the nav bar. Is this possible? If so, how? To make it
even more fun, some of the page names are entry points to another section of
the site. If I can make "Other" a different colour, for example, I'd also
like to make pages in the "Other" folder have this same feature so that
readers know that they're in the "Other" section of the site. Or is this too
much?

View 2 Replies


ADVERTISEMENT

Border Around An Object - Change The Background Colour And Font Colour Of Some Elements

Sep 22, 2009

I am using javascript code to change the background colour and font colour of some elements called 'filled') dynamically. For example:

if(timeInputValue >= startcode && timeInputValue < endcode && stateInput.value == "playing") {
filled.style.backgroundColor = '#ffffff';
filled.style.color = '#000000';
}

I also want to put a border around these 'filled' elements too - how can I do this is javascript? I can't find an equivelent to style.border = "1px"

View 1 Replies View Related

Set BG Colour And Than Change To Another Colour On Click?

Sep 7, 2010

How do I do this? I've set up javascript to change the background colour depending on what colour square the user clicks on, this is working fine.However, I want to be able to set an initial colour, other than white, and then let the user chose their own.

here is my code so far.

<script language="JavaScript">
<!--
function changeBGC(color){

[code]....

I want the page to be initially set to the brown colour, then I want the user to be able to choose their own colour.

View 6 Replies View Related

JQuery :: Way To Toggle The Background Colour Of A Page ?

Feb 10, 2011

I am trying to make a way to toggle the background colour of a page.

I have managed to find this way, but instead of two seperate links I just want to have an icon which when clicked once changes the colour and changes the icon, then clicked again returns to the other colour and replaces the icon.

Here is my code so far:

View 3 Replies View Related

Change Text Link Colour / Restore Link Colour?

Apr 11, 2010

I'm trying unsuccessfully to get some text links to change & restore their colour.

[URL]

Referencing this link - there are 3 text links at the top of the page, which scroll to different anchor points on the same page.I need the following to happen: On hover, change colour (easy using css) On click link A, change colour When clicking link B, link A restores to original colour.

View 4 Replies View Related

Cell Height - Code Only Works When Placed In Or After The Cell Being Measured

Jan 27, 2009

I have this layout

And then I have this code to determine the cell height.

So basically I need both my first and last cells to be able to have the mainbody cells height, but that code only works when placed in or after the cell being measured, in this case "mainbody", my question is this, is their a way to get the size of the mainbody cell before its done loading somehow?

View 3 Replies View Related

Cannot Move Input Focus To A Cell After Re-Defining The Cell

Sep 15, 2011

I have a javascript program that uses a HTML table as an Excel-like grid. The user can use arrow keys to navigation the grid. When the user selects a cell and then hits <Enter> key, the program turns the cell from read-only to editable (an input box), and select all the text in the input box. When the user hits <Esc>, the program cancels the changes that the user has made and turns the cell back to read-only. So far so good. The problem is that as soon as the user hits <Esc> key and turns the cell back to read-only, I find that I cannot move the input focus back to the cell any more. Actually I cannot move the input focus back to _any_ cell in the table. When this happens, the user cannot use arrow keys to navigate the grid any more (like the grid has lost the input focus). The user needs to use the mouse to click at a cell in the table to get things working again.

The user can get around with this problem by un-selecting the text from the input-box before hitting <Esc>. But this is not something that I expect the user to remember to do. I need a way to fix this problem. I tried the logical thing and programmatically un-select the text before turning the cell back to read-only. But this actually made thing worse - this causes the workaround to stop working.

The only browsers that I have tested this program is IE6 and IE8. I have not tested this in any other browser.

Attached is a simplified version of the program that can show this problem in action. This simplified program first adds an empty table on the web page, and then creates an instance of the CEstGrid class that takes care of the grid. CEstGrid will add two rows of test data into the table with two columns in each row. The user should use a mouse to click at one of the cell, and the cell should be highlighted. The user uses arrow keys to navigate the table. When he reaches the end of the table, he will wrap around to the other side of the table. Let say the user reaches the cell in row-1 column-2, he hits <Enter> to change the cell to editable. He will find the text in that cell to be highlighted. When he hits <Esc> at this moment, he will find that he cannot use the arrow keys to navigate the table any more, and this is the problem. Please rename the test program from .TXT to .HTML to test it.

View 6 Replies View Related

Change Border Of Some Cell By OnMouseOver Different Cell?

Apr 11, 2010

imagine table with 15 rows and 3 columns. If I move mouse over any cell I want some other specific cells to change their borders like with pseudo-class :

example

<style>
.boryellow {border: 3px solid yellow}
.borblue {border: 3px solid black}
</style>

this will work, a cell can change itself

<td name="third" class="boryellow" onmouseover="this.className='borblue'" onmouseout="this.className='boryellow'">cell</td>
even when dealing with empty images - click on link will change border of different element - imgs, but not span or td ...
<a href="#" onclick="document.all.xxx.className='borblue'; document.all['name'].className='borblue';

[code].....

Replacing any element link by "third" or "spanx" will cause stuck ant not executing other actions.

View 4 Replies View Related

Script To Change Cell Color When Clicked And Back To Original When Other Cell Clicked

Mar 15, 2011

<script language="JavaScript">
function changeColor(cell_id){var state1="#dde6ed"; var state2="#ffc20e"; var cellid = new Array ("id1", "id2", "id3", "id4", "id5", "id6"); for(var i = 0; i < cellid.length; i++){var nav = document.getElementById(cellid[i]); if(cellid == nav.id){nav.style.backgroundColor=state2;} else {nav.style.backgroundColor=state1;}}}
</script>

what is wrong with this script. I put an onClick= changeColor(this);" in my <td> tag to call the script but still not working.

View 4 Replies View Related

Get The Cell Index Of The First Cell?

Mar 6, 2011

I have a table with two rows and 4 columns, the first cell has rowspan of 2. How do I insert something into the first cell only? How can I get the cell index of the first cell?

View 4 Replies View Related

Colour Changes

Oct 31, 2005

i have an image of a t-shirt and i want to use a colour picker type thing to change the images colour, is this possible, and if it is possible does anybody have any idea what code i would need for the script

View 1 Replies View Related

Text Colour

Jul 23, 2005

Being new to javascript, I'm stuck on what is obviously a simple thing.
I have a script which finishes with a document.write statement to
print the result to the screen. This is all working OK, but how do I
change the colour of the text and make it bold?

I tried adding style.color = "yellow"; before the write statement,
but the colour was still black.

View 3 Replies View Related

Alternate Row Colour

Dec 9, 2005

I am generating a html based table with multiple rows of data coming
in real time from a postgres DB. The underlying technology is java
based however the front end is html.

now i am unable to alternate the colour of every row so that the table
is lot more readable. can anyone suggest a javascript or even a css
script which will alternate the row colours irrespective of the number
of rows.

View 4 Replies View Related

Colour Tools

Jan 16, 2004

I created some RGB-to-HSL and HSL-to-RGB functions for JavaScript that I think might be useful for some of you. function fnRgbToHsl(r, g, b){ // R G B as integers, 0..255.

r /= 255;
g /= 255;
b /= 255;
var
max = Math.max(r, g, b),
min = Math.min(r, g, b),
l = (max + min) / 2;
h = 0,
s = 0;
if(max != min){
s = (l < .5)?
(max - min) / (max + min):
(max - min) / (2 - max - min)
h = (max != r)?
(max != g)?
4 * (r - g) / (max - min):
2 * (b - r) / (max - min):
(g - b) / (max - min);
}
h *= 60;
if(h < 0)
h += 360;
return [h, s, l];
}

function fnHslToRgb(h, s, l){ // H as degrees 0..360, S L as decimals, 0..1.
h /= 360;
function fnHueToRgb(x, y, h){
if(h < 0)
h += 1;
else if(h > 1)
h -= 1;
return ((h * 6 < 1)?
x +(y - x) * h * 6:
(h * 2 < 1)?
y:
(h * 3 < 2)?
x + (y - x) * (2 / 3 - h) * 6:
x);
}
var
y = (l > .5)?
l + s - l * s:
l * (s + 1),
x = l * 2 - y,
r = fnHueToRgb(x, y, h + 1 / 3) * 255,
g = fnHueToRgb(x, y, h) * 255,
b = fnHueToRgb(x, y, h - 1 / 3) * 255;
return [r, g, b];
}

If I get the time, I'll build some tools around them, such as methods of getting triad colours, complementary and split complimentary colours, analogous colours, saturation variations, luminance variations (tints and shades) and hue variations (chromatic variations).

View 2 Replies View Related

Changing The Colour Of An <a> Tag?

Sep 8, 2011

The button is a blob of colour (.jpg) with text over the top. I want two things to happen: first, when the cursor is rolled over the .jpg and then the text, I want the text to change colour. This works ok. Second, I want to link to industry.php when clicked. This works ok over the .jpg but, obviously, not over the text.

[code = PHP]
echo '<div id="industry_button"><a href="industry.php" onmouseover="Roll_Industry(true)" onmouseout="Roll_Industry(false)">
<img name="Industry" src="graphics/industry_button.jpg" width="133" height="30" /></a>

[Code]....

View 4 Replies View Related

Changing Background Colour

Jul 23, 2005

I spotted some nice code to change the background colour of a web page to
one of four different colours at random but I can't find it now!

The method was to select a number at random from 1 to 4 by using the rnd()
function and then dividing by modulus 4. The result was then used to select
a cell in a 4 cell array which was holding a different colour in each cell
of the array. I would like to have this code but lack the knowledge to
re-create it.

View 4 Replies View Related

Get Background Colour Color?

Sep 10, 2009

I'm just trying to do something pretty simple which is an alert box which will give me the background color. So simple that it doesn't want to work, that is!

The line the body is onmouseover: <p id="metallic" onMouseOver="switchElementColour('metallic');">metallic c-prints</p>
The function is as follows
function switchElementColour(elementName){
var tryId = document.getElementById(elementName);
var yrf = tryId.style.backgroundColor;

[Code]...

View 4 Replies View Related

Changing Colour On Click?

Oct 3, 2011

How come this isn't working?

document.getElementById('glance').style.display='block'.color='gold';

View 3 Replies View Related

Change The Colour Of A Scrollbar?

Jun 3, 2010

is there an easy way to change the colour of a scrollbar without using java?

View 2 Replies View Related

Change Background Colour Of Div Using JS?

Mar 21, 2009

I wish to change the background colours of two divs, one is blue and the other is gray.i already have the pull down onchange working that changes the fields to active or disabled depending on the selection made and wish to change the background to gray out the div that has disabled fields.how is this done using Javascript

View 1 Replies View Related

Slider/fade With Colour?

Feb 4, 2011

Ive seen on the fox website home page (although this is flash), when the top programme image changes, so does the background colour values of their logo... can this be achieved in js?

From my perspective, i want a image gallery (fade/slider)(pulled from a database), then create some kind of array (maybe in the image db record) of a #colour that i can can add to other elements..

View 1 Replies View Related

Generating A Colour Gradient

Jul 5, 2005

Im working on my own little javascript engine at the moment.

One of the functions i would like to add to it is a fadeToBackground function. In essence, it would detect the element that is calling it and find out the background colour for that element. From there it would take a hex colour that it is given and then fade to the background colour.

To do this i need to generate an array of inbetween colours. Ie, i need something like #000000, #0000EE, #0000FF etc etc.

Does anyone know of an algorithm to calculate the colours in between two given hex values?

I want to be able to dynamically generate the colours so it is a drop in function for down teh track where you just give it a colour to fade from and it does the rest.

View 6 Replies View Related

JQuery :: Changing Colour Scheme?

Jan 10, 2011

I'm looking to give viewers options for changing the colour scheme of a site. I've had a trawl through through the basic jQuery and UI capabilities, and it looks like toggleClass is the best option.

Has anyone other suggestions, from the range of other plugins?

The options will likely include changing the body backgound color, and background-image; changing text colour on certain classes; and changing the *content* of a div, which is the background layer for one area of the window.

View 2 Replies View Related

JQuery :: Change The Colour Of The Letters?

Aug 13, 2010

I'm trying to change the colour of the letters that have a link. Anyway it is not working correctly on Jquery

//Jquery
$("a").mouseover(function(){$().html(<a href="http://www.google.co.jp/"><font size="7">linktest</font></a>

[code]....

View 1 Replies View Related

JQuery :: Random Colour On Letters

Oct 30, 2010

Basically, I am wrapping a span around each letter of a link element, so i can apply a random class to it - thus creating a rainbow effect on text. My sticking point is that successive letters can't be the same colour, nor can the first letter of successive links.

So 'Link1' wouldn't be acceptable as L and i have the same colour, nor would 'Link1 Link2' as the two L's have the same colour. Also, the code I'm using to append the spans to each letter is also appending a span to any spaces in the links, is there a way I can stop this? I've attached all the files I'm using.

On the example I've attached, I have made each links first letter successive, so the colours will never be the same. I've also made spans from the second letter onwards so they'll never be the same - but occasionally it'll throw up a clash where the first and second letters of each link are the same colour.

View 1 Replies View Related

JQuery :: Change Colour On A Class?

Jul 9, 2010

I have this script which, on mouseover, shows a nested element of a class.

I want to add a snippet which, on click, changes the color of the class... maybe with a fast fade.

Does it require creating a second class with the new color? Something like:

$(document).ready(function(){
$('.class').hover(function(){
$(this).find('.bit').show();
}); //existing script

[Code]....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved