<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1043088" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1043088</link>
    <description></description>
    <language>en</language>
          <item>
    <title>decibel.places wrote:
You</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238551</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;decibel.places&lt;/em&gt; wrote:&lt;/div&gt;You mean the repeated IDs are invalid or some other part?&lt;/div&gt;yeah, repeated use of the same ID is not XHTML valid&lt;br /&gt;
&lt;code&gt;ID &amp;quot;test&amp;quot; already defined&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;decibel.places&lt;/em&gt; wrote:&lt;/div&gt;sure, why don&#039;t we ignore 45% of the viewers who choose or are forced to use IE :P&lt;/div&gt;Can&#039;t we just burn them instead? ...&lt;/p&gt;
 </description>
     <pubDate>Fri, 20 Feb 2009 19:11:50 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1238551 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>You mean the repeated IDs</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238481</link>
    <description> &lt;p&gt;You mean the repeated IDs are invalid or some other part?&lt;/p&gt;
&lt;p&gt;Yeah, getelementbyid would be pretty meaningless - like on last night&#039;s &lt;em&gt;LOST&lt;/em&gt; episode - the results would be &lt;em&gt;unpredictable&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I suppose the reuse of IDs works in the OP code because the elements with the same ID are the same type of element...&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;webwiz&lt;/em&gt; wrote:&lt;/div&gt;No. But there is &quot;getElementsByClassName&quot;. Supported by the latest version of all major browsers, apart from the &lt;strong&gt;usual suspect&lt;/strong&gt;.&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;sure, why don&#039;t we ignore 45% of the viewers who choose or are forced to use IE &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/tongue.png&quot; title=&quot;Sticking out tongue&quot; alt=&quot;Sticking out tongue&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 19 Feb 2009 19:07:58 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1238481 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>@decibel.places - That</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238478</link>
    <description> &lt;p&gt;&lt;strong&gt;@decibel.places&lt;/strong&gt; - That markup is, of course, not valid HTML- but you know that. I&#039;m not sure what &quot;getElementById()&quot; would return in such a case, either.(?)&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;teammatt3&lt;/em&gt; wrote:&lt;/div&gt;There is no built in method for getElementsByClass&lt;/div&gt;&lt;br /&gt;
No. But there is &quot;getElementsByClassName&quot;. Supported by the latest version of all major browsers, apart from the usual suspect.&lt;/p&gt;
 </description>
     <pubDate>Thu, 19 Feb 2009 18:49:19 +0000</pubDate>
 <dc:creator>webwiz</dc:creator>
 <guid isPermaLink="false">comment 1238478 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>you can repeat the id on</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238447</link>
    <description> &lt;p&gt;you can repeat the id on elements, but it is not recommended and can lead to confusions&lt;/p&gt;
&lt;p&gt;source of attached file:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;head&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;title&amp;gt; reuse id &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;style&amp;gt;&lt;br /&gt;&amp;nbsp; #test {width: 250px; height: 150px; background: red}&lt;br /&gt;&amp;nbsp; &amp;lt;/style&amp;gt;&lt;br /&gt; &amp;lt;/head&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;body&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;p id=&amp;quot;test&amp;quot;&amp;gt;Paragraph1&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;p id=&amp;quot;test&amp;quot;&amp;gt;Paragraph2&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;div id=&amp;quot;test&amp;quot;&amp;gt;&lt;br /&gt;	div&lt;br /&gt;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt; &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 19 Feb 2009 04:45:11 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1238447 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>But still interesting to</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238442</link>
    <description> &lt;blockquote&gt;&lt;p&gt;But still interesting to know why it didn&#039;t work when I changed the ID to a class.&lt;br /&gt;
Could it be something to do with this in the JS - getElementById? Should be getElementByclass?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Because the JS wants an ID, not a class (yup, that&#039;s why it used getElementById). As I said before, you can modify your CSS to make it use classes instead of IDs, but you still have to pass the Javascript an ID (even though the ID is not referenced by the CSS). &lt;/p&gt;
&lt;p&gt;There is no built in method for getElementsByClass &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You can write your own though. Or use a framework like jQuery.&lt;/p&gt;
 </description>
     <pubDate>Thu, 19 Feb 2009 03:23:07 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1238442 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>teammatt3 wrote:
You have</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238440</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;teammatt3&lt;/em&gt; wrote:&lt;/div&gt;You have to hard code the images in the CSS!&lt;/div&gt;My bad I linked to the wrong gallery. I did see that one first but decided against it for the same reason you mentioned&lt;br /&gt;
&lt;a href=&quot;http://www.stunicholls.com/gallery/photo_click.html&quot;&gt;This is the gallery I use&lt;/a&gt;&lt;br /&gt;
Which uses the code I pasted above (code in my first post is different to the one you have been viewing from the link)&lt;/p&gt;
&lt;p&gt;As I said, the issue is resolved by the galleries being on a second page one at a time. But still interesting to know why it didn&#039;t work when I changed the ID to a class.&lt;br /&gt;
Could it be something to do with this in the JS - &lt;code&gt;getElementById&lt;/code&gt;? Should be &lt;code&gt;getElementByclass&lt;/code&gt;?&lt;br /&gt;
(that&#039;s a guess as I really know no JS)&lt;/p&gt;
 </description>
     <pubDate>Thu, 19 Feb 2009 03:01:00 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1238440 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I just looked at the</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238437</link>
    <description> &lt;p&gt;I just looked at the script&#039;s CSS and it&#039;s not pretty. You have to hard code the images in the CSS! You&#039;d have to create a duplicate set of #gallery rules for every single gallery on the page and set all the thumbnail images.  &lt;/p&gt;
&lt;p&gt;You don&#039;t need to modify the JS. &lt;/p&gt;
&lt;p&gt;All in all, you need to create a bunch of copies of the #gallery rules and give them unique names (#gallery2, #gallery3, etc) and pass that ID to the JS.&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Feb 2009 22:25:00 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1238437 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>This issue is no longer</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238432</link>
    <description> &lt;p&gt;This issue is no longer relevant, the client wants a preview of each job then the gallery on a separate page after clicking the preview.&lt;/p&gt;
&lt;p&gt;But, I ca&#039;;t walk away from issues without figuring them out.. so are there certain CSS things that specifically require ID rather than Class?&lt;br /&gt;
Or is there some other reason the code didn&#039;t work with a class where it did with ID?&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Feb 2009 20:29:48 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1238432 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>yeah, changed the CSS to</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238429</link>
    <description> &lt;p&gt;yeah, changed the CSS to classes and altered HTML accordingly&lt;br /&gt;
(there is only one to alter anyway &lt;code&gt;#gallery&lt;/code&gt;)&lt;/p&gt;
&lt;p&gt;Although I&#039;m not sure why your example has ID and class?&lt;br /&gt;
&lt;code&gt;&amp;lt;div id=&amp;quot;gallery&amp;quot; class=&amp;quot;gallery&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Nor what the &lt;code&gt;gallery2&lt;/code&gt; is?&lt;br /&gt;
Is that a way I can call a second gallery with the JS? If yes, that would mean calling a new one for every gallery.... &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/doh.png&quot; title=&quot;Doh!&quot; alt=&quot;Doh!&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Feb 2009 18:26:00 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1238429 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Did you change your CSS to</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/html-and-css-doesnt-work-when-used-twice-same-page#comment-1238423</link>
    <description> &lt;p&gt;Did you change your CSS to use dots instead of hashes since you aren&#039;t using IDs anymore?&lt;/p&gt;
&lt;p&gt;E.g:&lt;br /&gt;
#gallery {width:550px; position:relative; float: left;}&lt;/p&gt;
&lt;p&gt;needs to be&lt;br /&gt;
.gallery {width:550px; position:relative; float: left;}&lt;/p&gt;
&lt;p&gt;HTML would look like&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;body onload=&amp;quot;clickMenu(&amp;#039;gallery&amp;#039;); clickMenu(&amp;#039;gallery2&amp;#039;)&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;div id=&amp;quot;gallery&amp;quot; class=&amp;quot;gallery&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;div id=&amp;quot;gallery2&amp;quot; class=&amp;quot;gallery&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Feb 2009 17:40:00 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1238423 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
