[Solved] Making a javascript file [closed]

[ad_1] Store this in a js file: $(document).ready(function(){ $(‘#slider-with-blocks-1′).royalSlider( {arrowsNav:true, arrowsNavAutoHide:false, fadeinLoadedSlide:false, controlNavigationSpacing:0, controlNavigation:’bullets’, imageScaleMode:’none’, imageAlignCenter:false, blockLoop:true, loop:true, numImagesToPreload:6, transitionType:’fade’, keyboardNavEnabled:true, block:{delay:400} }); $(‘.credit ‘).append(‘ credit by &lt;span&gt;&lt;/span&gt;’); $(‘.credit span’).html(‘<a/>’).attr(‘href:\\www.google.com’).text(‘This is my link to google!’); $(‘.credit span ‘).attr(‘id’, ‘credit’); $(“[role=”navigation”]”).flexNav(); }); $(window).load(function() { if (!document.getElementById(‘credit’) || document.getElementById(‘credit’).href != “http://www.google.com/”) { alert(‘Kreditnya jangan diilangin sob!’); } … Read more

[Solved] jquery countdown timer

[ad_1] I tried out the example you linked to. What version of Firefox are you using? On the example it says: “This page has been tested with IE 6, IE 7, IE 8, FF 3, Safari 4, Opera 9, Chrome 4 “ I think the issue might have to do with what browser version or … Read more

[Solved] jQuery syntax problem

[ad_1] HTML: <p>This is paragraph 1.</p> <p>This is paragraph 2.</p> <p>This is paragraph 3.</p> <p>This is paragraph 4.</p> <p>This is paragraph 5.</p> <p>This is paragraph 6.</p> jQuery: $(‘p:eq(0)’).html(“Helooo!!”); I suggest this, because it is easy to change it to apply for more elements, if necessary later. 1 [ad_2] solved jQuery syntax problem

[Solved] How do you give a user a role by role ID in Discord.JS V13 (latest)

[ad_1] You can do this something like same thing with getting member.id. const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) You can create the code similar to this. const role = message.mentions.roles.first() || message.guild.roles.cache.get(args[0]) Now you can adjust your code file: const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) const role = message.mentions.roles.first() || message.guild.roles.cache.get(args[1]) member.roles.add(role) //To add the … Read more

[Solved] Multiple jQuery Scripts in one HTML page Not working together

[ad_1] It’s a common global variable conflict issue. You can (must) wrap them all to self-executing function, which will keep all declared variables inside its own. (conflict): var test = $(‘#btn-1’).text(); $(‘#btn-1’).on(‘click’, function(){ console.log( test ); }); var test = $(‘#btn-2’).text(); $(‘#btn-2’).on(‘click’, function(){ console.log( test ); }); var test = $(‘#btn-3’).text(); $(‘#btn-3’).on(‘click’, function(){ console.log( test … Read more

[Solved] How turn on and off a disable button [closed]

[ad_1] You will need to use JavaScript. My example uses jQuery. The other examples cited are a little more complicated, so I made this for you. // find the elements var $form = $(‘form’); var $buttons = $form.find(‘input[type=button]’); // event logic $buttons.click(function(e) { $buttons.attr(‘disabled’, false); $(this).attr(‘disabled’, true); }); Put this in the onload or DomReady … Read more

[Solved] How to select every 2nd element of an array in a for loop?

[ad_1] Use modulus(%) operator to get every 2nd element in loop and add fontStyle on it: var myList = document.getElementById(‘myList’); var addList = [“Python”, “C”, “C++”, “Ruby”, “PHP”, “Javascript”, “Go”, “ASP”, “R”]; for (var i = 0; i < addList.length; i++) { var newLi = document.createElement(“li”); newLi.innerHTML = addList[i]; if(i%2==0){ newLi.style.fontStyle = “italic” newLi.innerHTML = … Read more

[Solved] Compare differences between two tables using Javascript [closed]

[ad_1] from the DOM table, if they are identical(structure), you can make a loop on the TDs of one of them and compare textContent to the other standing at the same position: here is an example const firstTable = document.querySelectorAll(“#table1 td”); const secondTable = document.querySelectorAll(“#table2 td”); // loop on one of the table if both … Read more

[Solved] How to create multiple object using single object in JavaScript? [closed]

[ad_1] You could use the Object.keys() methods to iterate over your object and then use the Array.map() method to transform your object to the array structure you need. var data = { “0”: “value1”, “1”: “value2” } var newData = Object.keys(data).map(key => ({ [key]: data[key] })) console.log(newData) –Update– You would simply need to change the … Read more