Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: 1 [2]

Author Topic: javascript problem  (Read 5908 times)

centered

  • Guest
Re: javascript problem
« Reply #15 on: December 07, 2009, 06:50:34 PM »

Now I saw, that all the li and ul lists ar like menu. Maybe there is possibility to make js code to work only for menu list?

Just checked your site, everything looks fine, what's the issue?
Logged

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: javascript problem
« Reply #16 on: December 07, 2009, 06:54:26 PM »

In this page list look awful :D
http://www.sietuva.lt/sitemap/
Logged
Aurea praxis, sterilis theoria.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: javascript problem
« Reply #17 on: December 07, 2009, 07:31:47 PM »

In this page list look awful :D
http://www.sietuva.lt/sitemap/

It looks OK to me in IE7... menu stays open too.
Well... at least it did when I first visited about 9 minutes ago. Then I tried to open the same URL in FFox and IE7 and your site now seems to be unresponsive... getting a "500" error".
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

centered

  • Guest
Re: javascript problem
« Reply #18 on: December 07, 2009, 07:35:00 PM »

Me too, can't see anything.  If it *looks* awful and Keys says it's oke, then it may be a CSS issue and not a JS problem.
Logged

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: javascript problem
« Reply #19 on: December 07, 2009, 07:37:53 PM »

Yes, something wrong with mysql today. All websites on that host sometimes getting 500 error.

That page content is  awfully displayed.

That sitemap should look like opened menu. It is done with simple li/ul. When I added js script, sitemap looks like now.
Logged
Aurea praxis, sterilis theoria.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: javascript problem
« Reply #20 on: December 07, 2009, 07:43:37 PM »

Yes, something wrong with mysql today. All websites on that host sometimes getting 500 error.
That page content is  awfully displayed.

That sitemap should look like opened menu. It is done with simple li/ul. When I added js script, sitemap looks like now.

OK... I can view it now again. Your template looks OK in IE7 but the right side-bar content (categories) are being pushed way down in the right sidebar (blue) column.

What sNews package are you working with? This might help us figure out what is happening.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: javascript problem
« Reply #21 on: December 07, 2009, 07:45:34 PM »

Working with 1.7 package.

Those categories are pushed because of the js script. I know that, because it appeared straight after I changed old menu script to newer.
Logged
Aurea praxis, sterilis theoria.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: javascript problem
« Reply #22 on: December 07, 2009, 07:47:49 PM »

Working with 1.7 package.

Those categories are pushed because of the js script. I know that, because it appeared straight after I changed old menu script to newer.

Then the jscript you've added IS conflicting, indeed. I'll leave this one for EQ.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

centered

  • Guest
Re: javascript problem
« Reply #23 on: December 07, 2009, 07:48:20 PM »

Something tells me you don't know javascript....  :-\

Anyway.... if your side menu top ul has an id of nav then use this:

Code: [Select]
<script type="text/javascript">
// You must credit me for this or you may not use it!
$(document).ready(function() {
$("#nav li > ul").each(function() {
$(this).hide();
});

var base = $('base').attr("href");
$("#nav a").each(function(){
if (base + $(this).attr("href") == window.location) {
$(this).parents().show();
}
});
$("#nav a").click(function(){
if (!$(this).attr("href")) {
$(this).next().toggle();
}
});
});
</script>
« Last Edit: December 07, 2009, 08:05:19 PM by equilni »
Logged

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: javascript problem
« Reply #24 on: December 07, 2009, 07:51:54 PM »

Yep, I totaly dont understand JavaScript. Thats why I was asking you to help :). Now everything works and looks perfectly. Thank you again! :)
Logged
Aurea praxis, sterilis theoria.

centered

  • Guest
Re: javascript problem
« Reply #25 on: December 07, 2009, 07:58:18 PM »

Working with 1.7 package.

Those categories are pushed because of the js script. I know that, because it appeared straight after I changed old menu script to newer.

That sounds like an HTML/CSS issue to me.  Why does some pages look fine and others don't?  JS would effect everything if that was the issue...
Logged

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: javascript problem
« Reply #26 on: December 07, 2009, 07:59:50 PM »

Working with 1.7 package.

Those categories are pushed because of the js script. I know that, because it appeared straight after I changed old menu script to newer.

That sounds like an HTML/CSS issue to me.  Why does some pages look fine and others don't?  JS would effect everything if that was the issue...

JS script effected the li/ul list type. That page content was made only of li/ul list. That was the problem ;)
Logged
Aurea praxis, sterilis theoria.

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: javascript problem
« Reply #27 on: July 01, 2010, 12:01:45 PM »

Ok. So I've been using this script:
Code: [Select]
<script type="text/javascript">
// You must credit me for this or you may not use it!
$(document).ready(function() {
$("#nav li > ul").each(function() {
$(this).hide();
});

var base = $('base').attr("href");
$("#nav a").each(function(){
if (base + $(this).attr("href") == window.location) {
$(this).parents().show();
}
});
$("#nav a").click(function(){
if (!$(this).attr("href")) {
$(this).next().toggle();
}
});
});
</script>
for a while now, and one thing is still anoyng me. In IE 6 this menu looks differently than in other browsers. Menu structure is like that:

Code: [Select]
<ul id='nav'>
  <li>Link</li>
  <li>Link to expand list
     <ul>
        <li>Link 2</li>
        <li>Link 2 to expand list
           <ul>
              <li>Link 3</li>
           </ul>
        </li>
        <li>Link 2</li>
     </ul>
  </li>
  <li>Link</li>
</ul>

All the browsers, exept the IE 6 show this menu closed (Link 2 and Link 3 are not displayed). IE6 show this menu expanded (Link 2 is displayed, but Link 3 is not displayed). I saw that IE6 shows expanded menu only when there is "Link 2 to expand list". If there is only the "Link 2", all the "Link to expand list" stays closed. And, when I got to other sub-category page, the IE6 browser show menu perfectly.

So, how to make IE6 show all the menu closed at the start page?
« Last Edit: July 01, 2010, 12:04:14 PM by Creatium »
Logged
Aurea praxis, sterilis theoria.
Pages: 1 [2]