Problem with jQuery Slide up/down... ideas?

Started by Hyperion (noobKID), July 06, 2013, 12:51:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hyperion (noobKID)

i did not say the old code worked... but i found out .htacces file inside js folder blocked the require_once code to get in the file i needed it to be...

this is my code i am usin now:

Code (javascript) Select

$(".news_headline").click(
function()
{
$(this).next('.news_body').slideToggle("fast");
}
);


and it works, so... yeah :P

ShadoW69

htaccess messing with jquery? :o
the actual code would have been
Code (javascript) Select

$(document).ready(function(){
    $('.news_body').click(function(){
        $(this).toggle();
    });
});

but it doesn`t matter... :P

Hyperion (noobKID)

sorry for late reply, but i fixed it myself last night (funny enough).
It was a damn .htacces, and some few lines i needed to turn around a little, but thanks for reply! :)

ShadoW69

Code (javascript) Select

$(document).ready(function(){
    $('.news_body').toggle();
});

Hyperion (noobKID)

Hey U-232... once again i have a little bit of a trouble.

I'm currently trying to add some jQuery to my own Torrent source, but have some trouble adding it to my code, and i am surten that i do it right (or close to it), but would be awsome if someone in here could help me out! :)

This is my JS code:

Code (javascript) Select

$(document).ready(
function()
{
$('#index_newsbox').toggle(
function()
{
$('.news_body').slideDown();//specific news-body...
},
function()
{
$('.news_body').slideUp();//specific news-body...
});
});


What i am ''trying'' to do here, is to make a jQuery code for my news-tool in my Home page so it will make a nice slide-down/up when clicked on the Div heading i have made.

The news body (news text) has a div class for itself, and plus a style of display:none;.

But still wont show... any ideas? This is my news code:

Code (php) Select

// === System news - Hyperion
$HTMLOUT .= box_start_full_size("Latest News");
$res = mysql_query("SELECT * FROM news WHERE added + ( 3600 *24 *45 ) >
".time()." ORDER BY added DESC LIMIT 2");

if (mysql_num_rows($res) > 0)
{
$button = "";
$id = "";

while($array = mysql_fetch_assoc($res))
{
if (get_user_class() >= UC_ADMIN)
{
$button = "
<div style='float:right;'>
<a href='#'>Edit</a>
&nbsp;
<a href='#'>Delete</a>
</div>";
}

$HTMLOUT .= "
<div class='news_headline'>
<span class='span_news_headline'>
{$array['headline']}\n
</span>

{$button}
</div>\n";

$HTMLOUT .= "<div style='display:none;' class='news_body'>";

$HTMLOUT .= "<span style='float:right;'>".get_date( $array['added'], 'TINY' ) . "</span>\n";
$HTMLOUT .= nl2br( $array['body'] );

$HTMLOUT .= "</div>\n";
}
}
$HTMLOUT .= box_end_full_size();


Ideas could be AWSOME! Thanks in advance boys and girls! x)...