Skip to main content

Posts

How do I get to #1 of html page using jQuery Address

I'm using asual jquery address plugin for page navigation. But I have a little problem. When I'm inserting mypage.html#first_paragraph address plugin recognize this as new page, not as "goto operation". And I just want this link to go to that place of my page. How can I do this? For example: http://developer.android.com/reference/android/widget/ListView.html#addFooterView(android.view.View ) see, when you click on this link its automatically goes to that place of page (with the addFooterView method) When I'm trying to release this using jquery address plugin, this (<a href="ListView.html#addFooterView(android.view.View)">ListView</a>) link (it opens new page) is recognizing as link (not "go to this part of page" operation)

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why Json is null in this situation?

I'm trying to return a JSON encoded array from a PHP page via ajax. here's my code from the calling page $('#test_load').click(function(){ $.ajax({ type:"POST", url:'/actions/admin_load.php', dataType: 'json', asynch:false, data:"action=4", success: function(json) { alert("we're back"); alert(json.a); } }); }); here's my php code //return json array case "4" : $str2 = "HELLO"; $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); $str = json_encode($arr); echo $str; break; I keep getting "json is null". Any suggestions would be much appreciated

jquery mouseenter mouseout in menu

I met some jquery menu mouseenter problem. How to fix when mouse enter p , the p still display block ? <script> $(document).ready(function() { $('a').mouseenter(function(){ $('p').css('display','none'); $(this).next('p').slideDown('slow'); }).mouseleave(function(){ $('p').slideUp('slow'); }); $('p').mouseenter(function(){ $(this).css('display','block'); });​ }); </script> <div> <a>menu1</a> <p>about us</p> <a>menu2</a> <p>contact</p> </div> <style> div{ position:relative; z-index:0; width:600px; height:20px; } p{ display:none; position:absolute; top:20px; left:0; width:300px; height:100px; background:#ccc; }​ </style> ​ Live demo: http://jsfiddle.net/KTvf7/

JQuery code not working

I am trying to find a cell in a table that has a class of 'empty', i am then using a bit of code to find the id(cell number) so i can the find out what cells are next too it. just too see if it works, i am trying: console.log($('.empty').attr('id')); but Firebug just returns 'undefined' each cell has the class of 'box' and only one has empty as well so 'box empty'. Any asssitance would be much appreciated.