Posts by Erlon Charles • 5,352 points
161 posts
-
2
votes4
answers4295
viewsA: Way to make a comparison between three variables
The easiest way to do this is by separating the comparisons, so you will be able to know exactly what is giving true or false. Example: <?php if(($a == $b) && ($a == $c)) { return true; }…
-
-1
votes1
answer880
viewsQ: What is the best way to know if a URL is working?
Some time ago I had to check if an external image existed to be able to show it, at that moment I used it: <?php $file = 'http://answall.com'; $file_headers = @get_headers($file); $position =…
phpasked Erlon Charles 5,352 -
6
votes5
answers18134
viewsA: Using jQuery, how to select elements with two CSS classes
When you say that an element has several properties in both the css how much in the jquery you insert all selectors and pseudo classes together Example: #id.classe1.classe2[atributo=valor] {…
-
1
votes3
answers2193
viewsA: How to Mount a Dynamic Checkbox
You can both use a select of the kind multiple. <select type="multiple"> <option value="1">Primeira opção</option> <option value="2">Segunda opção</option> <option…
-
5
votes11
answers97880
viewsA: Center image vertically within a div
What’s missing is the display:table; in the container of div who is with display: table-cell; Putting this will work perfectly. take the example: CSS: #container { width: 200px; height: 150px;…
-
28
votes5
answers62952
viewsA: How to remove edge of input and textarea from all browsers when clicked?
This is not standard of all browser, I can assure you. If this is happening on all browsers, there is a possibility that you are using bootstrap or any other library that has css inlaid If you…
-
2
votes5
answers2130
viewsA: How to add a class to a <li> by clicking on it, leaving only it with this class?
Use the .siblings() so vicê will only alter the elements that are within the same level of ul $( document ).ready(function() { $('li').click(function() { $(this).siblings().removeClass('selected');…
-
14
votes6
answers42802
viewsA: What is the difference between . on("click", Function() {}) and . click(Function() {})?
Overall .click() is really a shortcut to .on(), whereas the .on() serves for any event, both the natives and the customized ones and not only the click, this way if by chance you are using a dynamic…
jqueryanswered Erlon Charles 5,352 -
4
votes2
answers2560
viewsA: Accessing another controller’s variable - Cakephp
Hello, you can create a requestAction. With it you can use both the same controller and other controllers, but don’t forget to create the elemment of cache.…
cakephpanswered Erlon Charles 5,352 -
2
votes2
answers2791
viewsA: How to treat a "redirect" after an Ajax call with Jquery?
Ajax in jQuery has 3 calbacks that can be used for what you want complete, Success and error, you could use both the complete as to the error to make that check. Take the example: $.ajax({…
-
1
votes3
answers419
viewsA: In a menu of 3 levels, how to set a time when the event is mouseout on the second level to the third level?
Instead of using the .css() you could use the .animate(), so you could control how long the animation would take to happen. currentMenu.find('.second-nivel').animate({ height: heightSubnivel },…