FC Jamison 31 Posting Pro in Training Team Colleague

I know of course that the "C" stands for "Cascading", but I always prefer to think of it as "Concatenating". The various appropriate styles for an element concatenate together into an overall "meta" style for that element. Any duplicate values are replaced during this process. That helps me understand it a bit better when I'm designing a site.

I know what concatenate means from my C++ programming classes. I never thought of CSS that way...but you are absolutely correct.

lol

FC Jamison 31 Posting Pro in Training Team Colleague

You mean like

<FORM><input type="file" name="FILE_NAME" /></FORM>
FC Jamison 31 Posting Pro in Training Team Colleague

Yeah...CSS is called cascading because the styles cascade from the top down.

if you have

td { margin: 5px; color: red }

.tdClass { margin: 0px }

and a tag <td class="tdClass">stuff</td> your td will have a margin of 0px (from the class) but the text color will be red (from the td style).

It takes some getting used to.

FC Jamison 31 Posting Pro in Training Team Colleague

What resolution is your monitor set to?

It appears to be looking normally in 1024 x 768.

FC Jamison 31 Posting Pro in Training Team Colleague

I believe it is a br=owser setting

FC Jamison 31 Posting Pro in Training Team Colleague

You're Pretty When I'm Drunk (The Bloodhound Gang)

FC Jamison 31 Posting Pro in Training Team Colleague

No. put it in your css beneath your body styles.

body {
 background-color: #bea163;
 margin-top: -3px;
 margin-bottom: -20px;
}

blockquote { margin: 0px; }


.text {
 font-family: Verdana, Arial, Helvetica, sans-serif;
 font-size: 15px;
 font-style: normal;
 line-height: 1.2;
 font-weight: lighter;
 font-variant: normal;
 color: #000000;
 text-align: left;
 vertical-align: top;
 padding-right: 5px;
 padding-left: 2px;
 padding-top: 8px;
}
FC Jamison 31 Posting Pro in Training Team Colleague

No More Words (Berlin)

FC Jamison 31 Posting Pro in Training Team Colleague

Strip (Adam Ant)

FC Jamison 31 Posting Pro in Training Team Colleague

No Disco (Depeche Mode)

FC Jamison 31 Posting Pro in Training Team Colleague

"Youthquake" (Dead or Alive)

FC Jamison 31 Posting Pro in Training Team Colleague

Save a Prayer (Duran Duran)

FC Jamison 31 Posting Pro in Training Team Colleague

Did you try

blockquote { margin: 0px; }

FC Jamison 31 Posting Pro in Training Team Colleague

That won't center it in the browser window, though...will it?

I mean, it will work for a specific resolution on a specific browser, but not across all platforms.

FC Jamison 31 Posting Pro in Training Team Colleague

I wasn't responding to DMR, I was responding to Salem.

DMR snuck that in while I was typing...lol.

FC Jamison 31 Posting Pro in Training Team Colleague

No Problem

FC Jamison 31 Posting Pro in Training Team Colleague

Your problem is that you have two functions with the same name calling two forms with the same.


For the first form/script:

<script language="JavaScript" type="text/javascript">
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</script>
<center><p></p>
<form name="form" action="get">
<select name="site" size=1 onChange="javascript:formHandler()">

For the second form/scrpt:

<script language="JavaScript" type="text/javascript">
<!-- Begin
function formHandler2(form){
var URL = document.form2.site2.options[document.form2.site2.selectedIndex].value;
window.location.href = URL;
}
// End -->
</script>
<center><p></p>
<form name="form2" action="get">
<select name="site2" size=1 onChange="javascript:formHandler2()">

note changes to the function names, object names , form names, and select names.

FC Jamison 31 Posting Pro in Training Team Colleague

I didn't resurrect it...I just answered t. Don't shoot the messenger.

If you have a better solution, share it.

FC Jamison 31 Posting Pro in Training Team Colleague
/* atoi example */
#include <stdio.h>
#include <stdlib.h>

int main ()
{
  int i;
  char szInput [256];
  printf ("Enter a number: ");
  gets ( szInput );
  i = atoi (szInput);
  printf ("Value entered is %d, and its double %d",i,i*2);
  return 0;
}

Output:
Enter a number: 73
Value entered is 73, and its double 146
FC Jamison 31 Posting Pro in Training Team Colleague

Take On Me (a-ha)

FC Jamison 31 Posting Pro in Training Team Colleague

You have three columns of information (nav, content, right bar).

There are a couple of ways to do this...you can set specific widths for each and float everything to the left, or you can float the nav to the left anf the right column to the right (both with set widths) and let the center flow as needed.

FC Jamison 31 Posting Pro in Training Team Colleague

There are many programs that can convert video formats...

Canopus Pro Coder
TMPGEnc
Dr DIVX
VCD Easy
Windows Media Encoder
RM Converter

just to name a few

FC Jamison 31 Posting Pro in Training Team Colleague

Right off the bat I see 2 things...

if(c=getchar())!='\n')

should be

c == getchar();
if(c != '\n')

and

there is no getChar function, plus the fun() function calls itself.

FC Jamison 31 Posting Pro in Training Team Colleague

I'm not normally in the habit of handing out homework solutions...but you need to see a working example.

This is a working program:

#include <iostream>
using namespace std;

int main() {
  int  grade[10];
  int  count = 0;
  int  sum = 0;
  char reply;

  do {
    cout << endl;
    cout << "Enter the grades in whole numbers: ";
    cin >> grade[count];
    count++;
    cout << "Do you want to enter the next grade (y/n)? ";
    cin >> reply;
  } while(count < 10 && tolower(reply) == 'y');

  if(count == 10) {
    cout << "maximum number of grades reached." << endl;
  }

  double average = 0.0;

  for(int i = 0; i < count ; i++) {
    sum += grade[i];
  }

  average = sum/count;
  cout << endl;
  cout << "Average grade is " << average << endl;
  cout << endl;
  return 0;
}
FC Jamison 31 Posting Pro in Training Team Colleague

No...and no.

Your for loop should be formatted similar to

for(int i = 0; i < count ; i++) {
average += grade[i];
}

() and {} do not do the same thing.

There are many other problems with this code as well.

FC Jamison 31 Posting Pro in Training Team Colleague

Convert the string to a character array and then use atoi

FC Jamison 31 Posting Pro in Training Team Colleague

I think you're in the wrong forum, my friend.

FC Jamison 31 Posting Pro in Training Team Colleague

Yeah...the actual conversion would have to take place on the server.

FC Jamison 31 Posting Pro in Training Team Colleague

Javascript can only size or resize a window that has been opened with javascript.

FC Jamison 31 Posting Pro in Training Team Colleague

This page might be of some help...

http://www.microsoft.com/mind/0398/how0398.asp

FC Jamison 31 Posting Pro in Training Team Colleague

Why would you want to annoy your visitors like that?

FC Jamison 31 Posting Pro in Training Team Colleague

I wouldn't go preloading multiple 4MB files. Look into streaming formats.

FC Jamison 31 Posting Pro in Training Team Colleague

Nice resource...thanks.

FC Jamison 31 Posting Pro in Training Team Colleague

Wouldn't you use basically the same code, except calling the sound files instead of images?

Bear in mind that sound files take much longer to download, so the transition won't be immediate.

FC Jamison 31 Posting Pro in Training Team Colleague

Well...without seeing the site, provide options for all table tags

If you want to get more specific, you can add class names for each row and/or column as well.

FC Jamison 31 Posting Pro in Training Team Colleague

Anything that can potentially be modified.

We would need to see the table and form to get more specific than that.

FC Jamison 31 Posting Pro in Training Team Colleague
<style>
    body { 
      background : url(images/tan-sponge.jpg) tan;
      margin:0px; 
      padding:0px; 
    }
  </style>
FC Jamison 31 Posting Pro in Training Team Colleague

OK Chief,

I have the solution you seek...

I am attaching two javascript files which both need to be referenced the head of each page you want to modify according to browser window size.

Here is an example of the code you would add to your head element (and the actual code for a site I am working on):

<link rel="stylesheet" type="text/css" href="resources/css/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="resources/css/jamExpressMenu.css" />
<link rel="alternate stylesheet" type="text/css" href="resources/css/stylesheet0800.css" title="800 x 600" />
<link rel="alternate stylesheet" type="text/css" href="resources/css/stylesheet1024.css" title="1024 x 768" />
<link rel="alternate stylesheet" type="text/css" href="resources/css/stylesheet1152.css" title="1152 x 864" />
<link rel="alternate stylesheet" type="text/css" href="resources/css/stylesheet1280.css" title="1280 x 1024" />


<script type="text/javascript" src="resources/scripts/externalLink.js"></script>
<script type="text/javascript" src="resources/scripts/setPage.js"></script>
<script type="text/javascript" src="resources/scripts/event_listeners.js"></script>
<script type="text/javascript" src="resources/scripts/resolution.js"></script>

In the resolution.js file, find the checkBrowserWidth function (shown below);

function checkBrowserWidth() {
  var theWidth = getBrowserWidth();

  if (theWidth == 0) {
    var resolutionCookie = document.cookie.match(/(^|;)msjc_res_layout[^;]*(;|$)/);

    if (resolutionCookie != null) {
      setStylesheet(unescape(resolutionCookie[0].split("=")[1]));
    }

    addLoadListener(checkBrowserWidth);

    return false;
  }

  if (theWidth <= 800) {
    setStylesheet("800 x 600");
    document.cookie = "msjc_res_layout=" + escape("800 x 600");
  }

  else if (theWidth > 800 && theWidth <= 1024) {
    setStylesheet("1024 x 768");
    document.cookie = "msjc_res_layout=" + escape("1024 x 768");
  }

  else if (theWidth > 1024 && theWidth <= 1152) {
    setStylesheet("1152 x 864");
    document.cookie = "msjc_res_layout=" + escape("1152 x 864");
  }

  else if (theWidth > 1152) {
    setStylesheet("1280 x 1024");
    document.cookie = "msjc_res_layout=" + escape("1280 x 1024");
  }

  return true;
};

Simply change the if statements to the 'theWidth' numbers to the screen sizes you …

FC Jamison 31 Posting Pro in Training Team Colleague

Ha!

I had tried document.styleSheets[i].rules[i].style.float but not your solution.

It works as you said, and now I can move forward. Thanks!

I had already written the code to solve the problem of updating the stylesheets, I just couldn't grab the value in IE.

The completed function is as follows:

function getStyle() {
	
  if(navigator.appVersion.indexOf("MSIE")!=-1){ var ie = true; }
 
  var sheets = document.styleSheets;
	
  for(var i = 0; i < sheets.length; i++) {
			
    if (ie) { var rules = sheets[i].rules; }
    else { var rules = sheets[i].cssRules; }
 			
    for (var j = 0; j < rules.length; j++) {
      if (ie) {
        var selector = document.styleSheets[i].rules[j].selectorText;
        if (selector == ".topMenuLink") { alert(document.styleSheets[i].rules[j].style.styleFloat); }
      }
				
      else {
        var selector = document.styleSheets[i].cssRules[j].selectorText;
        if (selector == ".topMenuLink") { alert(document.styleSheets[2].cssRules[8].style.getPropertyValue('float')); }
      }
    }
  }
}

Too bad there is not a way to grab any property in IE. document.styleSheets[i].rules[j].style.styleFloat works for float, but you have to use document.styleSheets[i].rules[j].style.width to grab widths.

The more I dig in to this, the less I like IE...LOL!

Thanks again!

FC Jamison 31 Posting Pro in Training Team Colleague

I know this is an old thread, but I thought it was worth resurrecting for a solution.

The following script will disguise the e-mail link

<a href="mailto:name@server">name@server</a>

as

<script type="text/javascript">emLink("eman, revres");</script>

You simply reverse the order of the letters (name = eman, server = revres).

function stringReverse(textString) {
  if (!textString) return '';
  var revString = '';
  for (i = textString.length-1; i>=0; i--)
    revString+=textString.charAt(i)
  return revString;
}

function emLink(name, server) {
  var rname    = stringReverse(name);
  var rserver  = stringReverse(server);
  var email    = rname + "@" + rserver;
  var mailText = '<a href="mailto:' + email + '">' + email + '</a>';
	
  document.write(mailText);	
}

I hope that helps someone.

FC Jamison 31 Posting Pro in Training Team Colleague

Can we see your code, please?

FC Jamison 31 Posting Pro in Training Team Colleague

OK...here's the background:

I want to use javascript to write a CSS dropdown menu. Since I want to be able to float the menu to either the left or the right depending on the site I am using it on, I need to grab the float value (either right or left) from a stylesheet.

I know I can simply add a variable to the script and be done, but now I just want to see if this can be done. This would be a very useful function for other javascript programs as well.

The only pain in my behind is Internet Explorer. In Netscape, Opera, and Firefox, I can simply use

document.styleSheets[i].cssRules[j].style.getPropertyValue('float');

Is there an Internet Explorer equivalent for this? I have spent two days googling for this with no glory.

So far in internet explorer, I can get as far as retrieving the selector...but I just can't figure out how to get a specific property from it to use in a conditional statement. i.e.

if (property == 'right) { do this; }
else { do that; }

To get the selector in IE, I use this:

document.styleSheets[i].rules[j].selectorText;

I just need that final snippet!

Thanks.

FC Jamison 31 Posting Pro in Training Team Colleague

I'm not understanding your problem.

Can you post your code so I can run it and see exactly what you mean?

FC Jamison 31 Posting Pro in Training Team Colleague

I'm not familiar with this style...but I think I have the general idea.

You could use a container div with nested divs inside. Set the nested divs to the width of one character (this creates the top-to-bottom effect), then float each of the nested divs on the right margin (this will create the right-to-left effect).

FC Jamison 31 Posting Pro in Training Team Colleague

Firefox is only CSS2 compliant not CSS3

FC Jamison 31 Posting Pro in Training Team Colleague

Hmm...

yes...it can be done.

You will need to creat another .js file and add the following:

if (window.screen.width <= 800)
  document.write('<img name="" src="image1.jpg" width="779" height="550" alt="">');
else
  document.write('<img name="" src="image2.jpg" width="1003" height="725" alt="">');

You call this javascript from the location in the html page where you want the image to appear.

<body>
  <script src="image.js" type="text/javascript"></script>
</body>

Also, screen.width worked in my browser, but you might also try window.screen.width in the switch statement of the codes I posted earlier.

There is a more complicated code I have been working on that will do exactly what you want...resize the page when the resolution (or browser size) is changed. It will take me a day or so to see if I can get it to work right in Opera.

FC Jamison 31 Posting Pro in Training Team Colleague

did you refresh your browser window?

It will only resize the image when the page is loaded.

FC Jamison 31 Posting Pro in Training Team Colleague

Well...almost the same result. The first code checks the screen resolution, the second code checks the browser window width.

It depends on what you want to base your image size on.

FC Jamison 31 Posting Pro in Training Team Colleague

Use one or the other in your .js file. They should both yield the same result.

You can then modify the code to fit your needs.

FC Jamison 31 Posting Pro in Training Team Colleague

Try changing the last line of the code to

d.style.minHeight = wh + 'px'; // Set minimum div height to window height

If that doesn't work, you'll have to use a conditional statement like

if (dh < wh)
  d.style.height = wh + 'px'; // Set div height to window height only if div height is less than window height;