Isotope not responding to class name - php

I have a class that works with isotope.
The trigger class is loaded through jquery from a PHP file and is therefore not loaded right away.
I can see the class in the DOM, but not in the source code.
Should this stop it from working all together?
I am not sure what code I can post in relation to this, because it is a huge project and the content of the php loads fine through the jquery call, but the isotope does not work when I do it this way.
To clarify if I load it in the html file directly, the isotope works. So that is confirmed.
It only stops working when it loaded from the PHP file, however it is still displaying all the divs.
Any ideas?
========
added binding code
<li>All</li>
<li>Chair</li>
<li>Secretary</li>
<li>Treasurer</li>
<li>Admin</li>
Thanks :-)

It works now
I had to change
$('#menu-items').html(msg);
into this:
$('#menu-items').html(msg);
$('#menu-items').isotope('reloadItems');

Related

Replacing HTML tooltip content with PHP/jQuery

So, I have that WordPress website on which I installed a template (Zoo). My problem is that I want the whole site to be in French, and there are three buttons in that template which title tag is coded deep in a js file that is inside a plugin which has been integrated to the template.
These are my first steps as a web developer (I come from C++) and I'm having quite a hard time understanding what is missing in the files, but I understood a few things by looking around.
So I made a child theme. This is the functions.php file. I think it works fine, but here it is in case I am doing it wrong :
<?php
function removethosedamntooltips(){
wp_register_script('removetooltips', get_stylesheet_directory_uri() . '/js/removetooltips.js');
wp_enqueue_script( 'removetooltips' );
}
add_action('wp_enqueue_scripts', 'removethosedamntooltips');
This is the aforementioned removetooltips.js file. I believe I have to call for a button hover because the template is single-page parallax and the buttons I want to modify are not visible until you click another button which allows for another display without sending the browser to another URL (if I remove line 2 and the closing brackets that go with it, it doesn't work anyway). Also, those tooltips appear only on mouse hover, so it seems a good idea :
jQuery(document).ready(function(){
alert("jQuery!!");
jQuery("button").hover(function(){
alert("jQuery!!");
jQuery(".mfp-arrow-left").attr("title", "Précédent (flèche gauche)");
jQuery(".mfp-arrow-right").attr("title", "Suivant (flèche droite)");
jQuery(".mfp-close").attr("title", "Fermer (Esc)");
});
});
The first alert displays after the page is loaded, but the second one does not show up. The tooltips (button title) still show up in English.
A piece of information that might be useful to solve this problem (I'm only 2 days into reading stuff about JavaScript and jQuery so I don't really know): I had to use jQuery instead of $ or the console would tell me that $ is an unknown function. Do I need to somehow include the jQuery framework in my file (if so, where and how ?), although a calling for the jQuery library already shows up in the header ?
If you provide a solution that will remove the tooltips instead of replacing their content, I will be happy enough.
Thank you in advance !
Instead of using
jQuery("button").hover(function(){...});
You should find the container in which all buttons are placed or just use body
and use jquery .on() method. As far as I know it'll work.
so your complete code will be like this
jQuery(document).ready(function(){
alert("jQuery!!");
jQuery("body").on("hover", "button", function(){
jQuery(".mfp-arrow-left").attr("title", "Précédent (flèche gauche)");
jQuery(".mfp-arrow-right").attr("title", "Suivant (flèche droite)");
jQuery(".mfp-close").attr("title", "Fermer (Esc)");
});
});
Explanation:
Using .on() method binds the event with dynamically created elements too. As you mentioned in your question that buttons are not created until another button/link is clicked.
Edit: Tested this one and its working. I've removed the second alert because with that you won't be able to test.

What could cause something like that ? PHP - MYSQL failure

Firstly i want to explain how my script works..
I'am using script named TSUE and source code protect by ioncube. Script has own plugins system kind of like vbulletin's Addons system. For using this system i need to create new php function to get data from database and i need to create a template for use(show) them as i want.
I created very simple plugin sample code. I'm getting tid and added coloum in tsue_torrents table with this function;
and using by this template i can show this data which page i want!
here is template
(template name is example btw. need to call that template using by eval in function)
<div class="widget">
<h4>Plugins Example</h4>
<br />
{$output}
</div>
Everything is look fine
But when i add this plugins on my main page or anypage of script I getting error like this;
��\IsG�>��%x!��n�(.���d)D�94��]J��]�$A����4a}�.sҍ��z_VU/ #��/��#-�YYY�U�w��|������~�ܦ�Lz���ѷk����SK�z��н� �ч�v)7�q�m"���u�c&O:�$B�����Nm���œ �m6OOO<!І�/rP�V�5��f�� �s%�#;�� �4MT*S_t���=�����n������˷��7��D�Lw���4S�l�w�%#u��� Ⱥ/����p?�S�s�]�?o �c_�=�~*�u4�]��/*�'B-<[�<�T�ϓ�J'S`�>w�*?s���/�1K�ߩ�9j$:_��F<���O:��g~G79��~t���1��8�|��$��b?��H�T����L:)pq�C���P�4����Ӑ�+G|(zC�C�&�8�:�����9je)!����$�1�)�g1��p�B���̐g!-��N���D*' �Q*�o5�NJ<'%Ha��v,#A_$<���φ2��F�z.O�0J$��&.k,����6]�M�'9��&B#��*�4���Yʾ�Q�i� ���A�P��yV�n��ݴ��tJ?�&8�mO�h�3�ד(Jk�h��iVY��8v��Ô��k��Gˌ����B���b�5�"}��g��c>��vU�}���.l�:h��� `k��4KB=Ȃo�K 0QCz##=;���k�& 7m�+�Q4n�"m�I��E��x�>>�zNO���Ta�M䉆�H�}��v9k�Ӫ���a+�+��#��R����=h7-�H�����R�S�3�a���O�zݨʜ�Ԩu�Ғ��ԮL�mI>i��#�n��f��Juj�=_��0<��zyj�U�9�Z�k�y��H��J�0>����'8L�Z?K�(��QF�B7�������E�uB:�$�i����m�hV�F��AHU�փ� �,�!��wjZ�U��6�pH8y��#OOe� c��5C��\�ɼ :�.���Q]$�lm����%��I�=� ���C��Р��#O�89Pk5����M����f�]_�cc
Screenshot :
Okay; I found why i get that weird error.
I think it is because Dreamweaver CS6.. I don't know excatly reason but when i type my code another php editor , function work fine..

AJAX, PHP Copied Files not Found on Return to Browser

I am using 'jQuery AJAX PHP' to do some '.jpg' file copying (approx 330kb per file). I copy files to a new directory location.
When I return to the HTML and use jQuery to add an IMG tag to a Table element, some of the files I have copied are shown as Not Found with 404 errors, but they are there.
I am wondering if it is a speed error. I tried to slow down the return from the PHP, by reading the directory where the files had been copied to, but that did not seem to help.
Am I right in thinking it is a speed problem and does anyone have an idea as to how I may overcome this problem, because only by displaying the copied file, can I be certain it has been copied.
Sometimes I have the same problem with not loading the images. If you are going to use jQuery I will recommend that you put your script (which loads the images) in
$(document).ready(function() {
// put all your jQuery goodness in here.
});
The fact is that your DOM object is not ready when you want to show or make operation with it.
Don't forget to call
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
in the head of your HTML.
Having tried various options suggested here and some others, I researched, I decided to try putting the display of the images in a different function from the AJAX/PHP. In other words instead of processing the images in the result function of the AJAX call, I just passed the results from the success function to another function.
This seems to have cured my not-found displays.
This may be a coincidence, with something else going on, because I am very poor in the knowledge of the flow of the DOM.

jQuery Get for PHP files

I have this statement in my jQuery file:
$.get("homeTemplates/randomVids.php", function(data){$("#hVid").html(data);});
Where the contents of randomVids.php should be loaded into a div called hVid. However, this does not work for me: nothing seems to load when the line is executed.
I consulted this page for information.
Any help would be appreciated.
You should probably just use this...
$("#hVid").load("homeTemplates/randomVids.php");

Getting facebox to work in the qcodo/qcube php framework

I am using a framework called qcodo (which forked as qcubed) and is a PHP framework.
I want to do a very simple popup using the Facebox jquery plugin.
When someone clicks on the link and shown below in line 47.
Here is the file: http://github.com/allyforce/AF-upload/blob/master/Templates/profile_activity.tpl.php
<a href="complete_profile_popup.php?allyId=<?= $this->objAllyUser->Id?>" rel="facebox" title="Complete Profile" >Invite as Ally</a><br />
The Facebook installation worked fine, tested it just opening plain html and php files.
I just want to be able to render a working page within the Facebox pop-up.
But the current error is that it cannot recognize the method, even though it appears it has been defined.
UPDATE: Per one suggestion, used iFrame, but still getting nothing:
You should print the error you get. I will try to guess: have you declared your method as public? In the template you can access only public properties and methods. This is a very common mistake.
This issue/topic is being discussed in depth at http://www.qcodo.com/forums/forum.php/3/4007/

Categories