Arrays are faster when you don’t need logic, you can also use an string but it’s a little more triky.
// JS
var array = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio",
"Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"];
$("div").text(months_array.indexOf("Febrero") + 1);
See a real example:
Avoid switch statement when you don’t need logic
/in JavaScript/by GénesisArrays are faster when you don’t need logic, you can also use an string but it’s a little more triky.
See a real example:
Avoid Navbar in Bootstrap from collapsing
/in CSS3/by GénesisCreate a simple Bootstrap Navbar without collapsing in cell phones and tablet devices.
You just need to add this code to your style.css
See a real example:
Unhide automatically one topic per week in Moodle
/in CSS3/by GénesisWe can hide and unhide manually topics in Moodle but we cannot do it automatically, maybe it will be developed in next versions but till then you can do it by yourself easily. Using Weekly format with Bootstrap default theme you can get “Current Week Class” (current), so the only thing you have to do it’s just hide every week after that one.
It’s working since Moodle 2.7.1 up to 2.9.1+.
See a real example:
Furthermore, if you want to have different students in different weeks in the same course (e.g. John in the second week and Jennifer in the last one) you can use “Self enrolment” to make courses start depending on when the students want to start the course and “Cohort” to avoid “Self enrolment” access to some courses.
Which is the different between property and attribute?
/in HTML5, JavaScript/by GénesisA property is in the DOM; an attribute is in the HTML that is parsed into the DOM.
HTML Attributes
Syntax:
DOM Properties
Syntax:
Using jQuery
If we have:
See a real example:
Upload a file with jQuery without opening a new page
/in JavaScript/by GénesisIn this example we are going to upload a file to our url using AJAX with jQuery.
Here if you want you can download my AJAX logo and use it for free: AJAX logo