MyBB Community Forums

Full Version: General jQuery Help Thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Also didn't work. Not sure what you mean by "style just sitting there" - it's set to display: none;
Weird it's changed now, it was:

<div id="register-section" style>
Register here
</div>

When I looked before. xD

But odd it's not working.
(2013-03-22, 05:41 PM)Eric J. Wrote: [ -> ]Try this out brad:

<script type="text/javascript">
jQuery.noConflict();
jQuery(function($) {

$('.register-link').click(function () {
    $('#register-section').show();
   $('#login-section').hide();
});

$('.login-link').click(function () {
    $('#login-section').show();
    $('#register-section').hide();
}); 

});
</script> 

I just added in a page load function and passed in $. Also you have style just sitting there in your #register-section tag. xD

This should work fine brad. At least if you didn't mean hide a div and show another div at the same time (in parallel). Then you should use callbacks.
I think my message in the OP makes pretty clear that's exactly what I'm trying to accomplish.

Also, maybe it should work, but it doesn't.
<script type="text/javascript">
jQuery.noConflict();
jQuery(function($) {

$('.register-link').click(function (event) {
   event.preventDefault();
   $('#register-section').show();
   $('#login-section').hide();
});

$('.login-link').click(function (event) {
   event.preventDefault();
    $('#login-section').show();
    $('#register-section').hide();
}); 

});
</script>

Sorry, this is the correct code. You are trying to trigger a click event on a HTML element quite particular ("a"). Preventing the default behavior should be enough to make it work.
Also does not work Sad

That said, I don't have to use a element. I can use any element.
Fixing these would probably help to avoid random errors as well. xD

http://i2.minus.com/izOpmOg8x2nUH.png
Analyzing your page with Chrome Console it seems to be an error within a previous script in the same page, which causes all the following code to be ignored and therefore not executed.

jQuery.noConflict();
jQuery(document).ready(function($){
jQuery("a[rel=logbox]").overlay();
});

There's no overlay(); method. Simply remove that line to correctly execute the following code, or place your script before that one.

Ninjed by Eric Toungue
This was given to me by someone else ... Dodgy

Thank you guys, I'll try some more later tonight.
(2013-03-22, 08:18 PM)brad-t Wrote: [ -> ]This was given to me by someone else ... Dodgy

Thank you guys, I'll try some more later tonight.

Lies! It was in your headerinclude but had an error, which I fixed because I was guessing that was the overlay plugin you were using, but I later found out it wasn't and fixed that problem.
Pages: 1 2 3 4