Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 279 Vote(s) - 3.66 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gpEasy CMS javascript hide/show text

#1
I'm currently working with the gpEasy CMS and I would need to reproduce the hide/show effect that is on this website:

[To see links please register here]

(links in the program).
I went to the code source and added the function showAbstract that was already here:

<!-- language: lang-js -->

function showAbstract(e){
f = e;
var div;
for(div = e.nextSibling; div.className != "abs"; div = div.nextSibling);

if (div.style.display=="block"){
div.style.display="";
} else {
div.style.display="block";
}
return true;
}

So I added it to my code and used the class="abs" to call it :

<!-- language: lang-html -->

<a href="javascript:void(0)" onclick="showAbstract(this)">Matrix completion ...</a>

<div class="abs"> Recent ubiquity ... </div>

Unfortunately, I just have the text displaying but not the effect expected. Would you have any idea ?

Thanks!
Reply

#2
The problem has to do with how you show/hide the <div>. Since you have jQuery, I would do something like this:

<a class="show_abstract">Matrix completion ...</a>
<div class="abs"> Recent ubiquity ... </div>
..

<script type="text/javascript">
$(function(){
$('.show_abstract').click(function() {
$(this).next('div.abs').toggle('slow');
});
});
</script>
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through