1
snow77
Making a: text link on .itemBody, news module class
  • 2006/9/20 13:24

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


since I haven't been able to make a td to do an a:hover, I've been trying to make the whole news text clickable with the same link as the read more link.

I don't know much about php or smarty code, but I did something and was wondering if it's ok like this or not.

Original code:
<div class="itemBody">
   <{
$story.imglink}><class="itemText"><{$story.text}></p>
</
div>


the change I did:
<div class="itemBody">
   [
color=990099]<a href="<{xoAppUrl /modules/news/storyid=<{$story.id}>}>">[/color]<{$story.imglink}><class="itemText"><{$story.text}></p>[color=990099]</a>[/color]
</
div>


what I added is in purple, if somebody sees this and thinks it's wrong, I'd thank you much to let me know

[edit] this is a piece of code from the news_item.html
www.polymorphee.com
www.xoopsdesign.com

2
Herko
Re: Making a: text link on .itemBody, news module class
  • 2006/9/20 13:41

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


can't you do a td:hover? it works for a p:hover

Herko

3
snow77
Re: Making a: text link on .itemBody, news module class
  • 2006/9/20 13:49

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


I'll try p:hover , thanks, well td:hover works on Firefox but not IE.

My above code was not working I have changed it once again to this:

<div class="itemBody">
   [
color=990099]<a href="<a href="<{xoAppUrl /}>modules/news/article.php?storyid=<{$story.id}>">[/color]<{$story.imglink}><p class="itemText"><{$story.text}></p>[color=990099]</a>[/color]
</div>


not sure if it's still right though, but at least now it seems to be taking me to the story
www.polymorphee.com
www.xoopsdesign.com

4
Herko
Re: Making a: text link on .itemBody, news module class
  • 2006/9/20 13:58

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


You can't have a html tag inside an anchor tag. So that'll break as well. What exactly are you trying to accomplish?

Herko

5
incama
Re: Making a: text link on .itemBody, news module class
  • 2006/9/20 14:01

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


This is a great article about the hover function on elements other that 'a'

http://www.xs4all.nl/~peterned/csshover.html

Hopefully MS will correct this in the new IE7 version, so we don't need to load extra pieces of code in the future,.
Webdesign
Sitting Ducks?!
I hate politics, give me a stylie instead...

6
snow77
Re: Making a: text link on .itemBody, news module class
  • 2006/9/20 15:48

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


after testing some more, the code for the .itemBody worked only if NO news topics displayed and if the news article had NO links in it, otherwise it went crazy. In conclusion it's almost useless.

Thank you Incama for the information ; I'm not so fond of javascripts but I think that will be the solution until a more intelligent IE comes out.

Herko, well I was trying to find a work around to do a :hover effect on the .itemOuter of news, but I was just messing up things doing a dirty way of making the .itemBody be a link and simulate the effect. And yes, I couldn't leave that anchor hanging outside like that.

The CSS was working ok though and maybe just maybe , it occurs to me it can be used in the forum, working out the templates a bit with something like this:

.forumTopic.even a {
color: #555;
display:block;
text-decoration:underline;
font-weight: normal;
}

.forumTopic.even a:hover {
color: #fff;
background-color: #993399;
text-decoration: none;
}

the display:block; will make the whole cell light up when mouse over a link and works on both Firefox and IE.
www.polymorphee.com
www.xoopsdesign.com

7
incama
Re: Making a: text link on .itemBody, news module class
  • 2006/9/20 17:54

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


I help you hoping Snow,.Adding hover pseudo's on all div's and classes will open a whole new world. There is another solution which involves a small dhtml script,.I just have to find it somewhere,.I'm sure it's on my pc.,.mmm,.,.but where,.

to be continued!
Webdesign
Sitting Ducks?!
I hate politics, give me a stylie instead...

8
snow77
Re: Making a: text link on .itemBody, news module class
  • 2006/9/20 20:03

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


gosh, after turning around all morning trying to make the .htc work ,,,and I finally never did.

The answer was always before my eyes, if you look at the Zeta theme it uses an IE fix and makes things behave like in Firefox.

Everything is working perfect now .

Thanks Incama for guiding me, check out the IE fix, you will like it.
www.polymorphee.com
www.xoopsdesign.com

Login

Who's Online

122 user(s) are online (85 user(s) are browsing Support Forums)


Members: 0


Guests: 122


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits