 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
krisimp
Joined: 27 Oct 2009 Posts: 3
|
Posted: Tue Oct 27, 2009 1:27 pm 2 Special Questions |
|
|
|
Hello,
i got 2 Problems with this Code:
| Code: |
<div class="cBlock1">
<table border="0" cellpadding="1" cellspacing="1" width="100%" class="infTable">
<tr>
<td nowrap class="infTitle" colspan="2"><a href="$ENTRY_URL$">$TITLE$</a>
<span title="Comments">(<a href="$COMMENTS_URL$"><b>$COMMENTS_NUM$</b></a>)</span>
<td nowrap align="center" width="50%" style="font:7pt">by <a href="$PROFILE_URL$">$USERNAME$</font></td>
<td nowrap align="center" width="75%" style="font:7pt">Size:<a href="$FILE_URL$">$FILE_SIZE$</font></td>
<td nowrap align="right" width="100%" style="font:7pt"><font color="#646464">[$DATE$]</font></td></tr>
<tr>
<td nowrap style="font:7pt"><?if($MESSAGE$)?><a href="$ENTRY_URL$">$MESSAGE$</a><?endif?></td></tr> </td></table></div> |
1st. This
| Code: |
<td nowrap align="center" width="50%" style="font:7pt">by <a href="$PROFILE_URL$">$USERNAME$</font></td>
<td nowrap align="center" width="75%" style="font:7pt">Size:<a href="$FILE_URL$">$FILE_SIZE$</font></td> |
i need to be displyed in the Center of the Complete Tablerow, but actually its Place is dertermined by the size of the $TITLE$ Text.
2nd.
| Code: |
| <td nowrap style="font:7pt"><?if($MESSAGE$)?><a href="$ENTRY_URL$">$MESSAGE$</a><?endif?></td></tr> </td></table></div> |
[/code]
I need the ability to decide the MaxLength of the $MESSAGE$ like when it Exceede 100 Charackters, skip all text behind and write ... instead.
Hope you can help me with this  |
|
nikki
Joined: 24 Nov 2008 Posts: 132
|
Posted: Wed Oct 28, 2009 3:55 pm Re: 2 Special Questions |
|
|
|
| krisimp wrote: |
2nd.
| Code: |
| <td nowrap style="font:7pt"><?if($MESSAGE$)?><a href="$ENTRY_URL$">$MESSAGE$</a><?endif?></td></tr> </td></table></div> |
[/code]
I need the ability to decide the MaxLength of the $MESSAGE$ like when it Exceede 100 Charackters, skip all text behind and write ... instead.
|
You can use javascript to show first few character of the message
| Code: |
function limitLength(){
var element = document.getElementById("message");
element.innerHTML = element.innerHTML.substring(0, 100)
element.innerHTML = element.innerHTML + "......";
} |
add attribute "id" to the anchor tag
| Code: |
| <a href="$ENTRY_URL$" id = "message"> |
|
|
nikki
Joined: 24 Nov 2008 Posts: 132
|
Posted: Wed Oct 28, 2009 4:06 pm Re: 2 Special Questions |
|
|
|
| krisimp wrote: |
1st. This
| Code: |
<td nowrap align="center" width="50%" style="font:7pt">by <a href="$PROFILE_URL$">$USERNAME$</font></td>
<td nowrap align="center" width="75%" style="font:7pt">Size:<a href="$FILE_URL$">$FILE_SIZE$</font></td> |
i need to be displyed in the Center of the Complete Tablerow, but actually its Place is dertermined by the size of the $TITLE$ Text.
|
Hope this helps
| Code: |
<div class="cBlock1">
<table border="1" cellpadding="1" cellspacing="1" width="100%" class="infTable">
<tr>
<td nowrap class="infTitle" colspan="2" width = "40%"><a href="$ENTRY_URL$">$TITLE$</a>
<span title="Comments">(<a href="$COMMENTS_URL$"><b>$COMMENTS_NUM$</b></a>)</span>
</td>
<td nowrap align="center" width="20%" style="font:7pt">by <a href="$PROFILE_URL$">$USERNAME$</font></td>
<td nowrap align="center" width="20%" style="font:7pt">Size:<a href="$FILE_URL$">$FILE_SIZE$</font></td>
<td nowrap align="right" width="20%" style="font:7pt"><font color="#646464">[$DATE$]</font></td>
</tr>
<tr>
<td nowrap style="font:7pt"><?if($MESSAGE$)?><a href="$ENTRY_URL$" id = "message">$MESSAGE$ </a><?endif?></td>
</tr>
</table>
</div> |
|
|
krisimp
Joined: 27 Oct 2009 Posts: 3
|
Posted: Thu Oct 29, 2009 10:23 am |
|
|
|
Thanks for your great Help!
Your Solution for my first Problem works nice. But only as long as the $MESSAGE$ isn't longer as then 40% else not. The $MESSAGE$ is supossed to be 100%.
Also i can't get the Javascript to work :/ i have added
| Code: |
<a href="$ENTRY_URL$" id = "dlmessage">$MESSAGE$ </a>
|
to the Anchor and
| Code: |
<script language="javascript">
function limitLength(){
var element = document.getElementById("dlmessage");
element.innerHTML = element.innerHTML.substring(0, 50)
element.innerHTML = element.innerHTML + "......";
}
</script>
|
to the Head or Body, also tried it in CSS but it's not working. (probably im to stupid) |
|
nikki
Joined: 24 Nov 2008 Posts: 132
|
Posted: Thu Nov 05, 2009 2:30 pm |
|
|
|
| Which browser are you using ? |
|
krisimp
Joined: 27 Oct 2009 Posts: 3
|
Posted: Sun Nov 08, 2009 12:49 am |
|
|
|
| Firefox 2 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|