Jump to content

mayfair

Newly Registered
  • Posts

    71
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mayfair's Achievements

Member

Member (2/5)

1

Reputation

  1. Thanks for the suggestions. I already have a thin skyscraper banner and I didn't want to put any more in for fear of overcrowding. As for the blog widgets - I already use those on the right-hand column where there is more space to put text. I guess I'll keep researching other similar websites and see how they make better use of their space
  2. Howdy, I was wondering if anybody out there uses a design with a 120px column and if so what content do you fill it with? I use a 3-column layout for advertisement purposes: [120] [520] [300] but I've been scratching my head lately for inspiration for what to put in the 120px column other than my existing navigation menu and a 120x600 skyscraper. It's too thin for social media widgets and anything wordy unless the text is reduced to ~10pt. Does anyone have a similar scenario or know of any creative ideas I can steal
  3. Hi haku, many thanks for your suggestion. Yes you are correct, but what I meant to say was you cannot call a function from an onload event anywhere other than the body of the document with a strict doctype. The thought hadn't occured to me to create and update the <p> tags using JS. I will have a bash at this now.
  4. Thanks for the reply thorpe, unfortunately it's not that simple. The JavaScript has to be called when each cell in a table loads to produce a "loading" effect where the cell contents appear after a few seconds. I've tried using an external JS file and calling a function bound to an onload event, but you can't have that on a Strict doctype either. This is what i've got so far: http://www.compareholidaymoney.com. This nearly validates apart from the Facebook "Like" button and the problem I described in my original post. What makes this even more difficult is the code is generated by PHP, so I have to write the JS inside PHP. I know that usually you would achieve this kind of thing with AJAX, but I don't know how to program it and I like to write all of my own code. To get the images to load, I set a 1px .GIF in place of the image, then use my nested JS to change it's SRC. In case you might be able to help any further, here is the code that is producing the invalid code: echo " <td class='delivery'> <div id='delivery".$row_number."'><img src='assets/images/loading.gif' alt='Loading'/></div> <script type='text/javascript'> setTimeout(\"document.getElementById('delivery".$row_number."').innerHTML='".$row['delivery']."'\",rand_num); </script> </td> "; where $row['delivery'] is called from a database and contains <p>text like this</p><p>with paragraph tags</p> Any other ideas would be much appreciated
  5. Hi Guys, Can somebody confirm for me whether or not you can insert HTML tags using innerHTML with a Strict Doctype? For example This validates: document.getElementById('something').innerHTML='blah'; This does not: document.getElementById('something').innerHTML='<p>blah</p>'; The error message produced by the validator claims "document type does not allow element "p" here". I need to enter multiple lines of text from a DB into a table cell. I have tried using <br/> tags and <ul>'s and the validator kicks off about all of them with the same response. Thanks in advance
  6. Hey Guys, I've got a table that contains an undetermined number of rows that I wanted to apply some kind of 'loading' effect to. I was originally going to use innerHTML or something similar, but after reading about the lack support for it in certain browsers, I decided to try and write some simple JS that hides/unhides each row of the table as it loads. My JavaScript skills aren't great, but I managed to achieve the desired effect. Unfortunately, I used the onLoad function on images which I realise now is not compliant with a STRICT doctype, nor does it validate to AAA2 accessibility standards. I have tried searching for an alternative, but as yet have come up with nothing. Let me explain a little bit more about how my code works: Each row of the table contains an image in the first column. When this image loads, it calls a function that instantly sets the row visibility to hidden, effectively hiding the row before it even appears on the screen. Then after a small, random amount of time, I set the row visibility back to visible. I can post the code here if it would help, or you can see the table in action here: www.compareholidaymoney.com (the function called by onload is located in an external file referenced in the header: index-js.js) What I would like to know is if there is an alternative to onload that I could use to achieve a similar effect that is compliant, and if not what the best way of achieving this effect would be. Thanks in advance to anyone that might be able to help. -mayfair
  7. Hi Wildbug, Many thanks for your reply and suggestions. I've implemented your code and it works nicely. -Mayfair
  8. Hi Guys, I'm trying to sort some multidimensional arrays, but my JavaScript skills are somewhat lacking. Here is the scenario: I have an (undetermined) number of multidimensional arrays that store the exchange rates for a particular company that look something like the following: supplier['company1']['eur'] = 1.1111; supplier['company1']['usd'] = 2.2222; supplier['company1']['cad'] = 3.3333; supplier['company2']['eur'] = 1.1111; supplier['company2']['usd'] = 2.2222; supplier['company2']['cad'] = 3.3333; supplier['company3']['eur'] = 1.1111; supplier['company3']['usd'] = 2.2222; supplier['company3']['cad'] = 3.3333; What I would like to be able to do is find the company with the highest exchange rate for a particular currency out of these arrays by using the onChange event of a drop down list. The VALUE of the drop down list is the currency symbol, so I can basically use that when the function runs to set which currency to search for. So for example; if I select Euros from the drop down list, it will search the arrays for the company with the highest 'eur' rate, and return the company name and eur rate associated with it. Thanks in advance to anyone who might be able to help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.