Jump to content

sugafree

Members
  • Posts

    50
  • Joined

  • Last visited

Everything posted by sugafree

  1. I want to create a main header where texts will bounce in, in 0.5s intervals and then at the same time it will all fade out, 1s interval again then new text will bounce in same intervals again and fade out. When it finished I want it to start from the beginning. I use animate.css, twitter-bootstrap and jquery. I have tried a few different ways, but so far I couldnt even get it to fade out after a short delay or if it fades out, it wont bounce in. http://erotikus-munka.co.uk/test/index2.html $( document ).ready(function() { $( '.main2' ).addClass( 'bt_visible animated fadeInDownBig'), $('.main2').addClass(3000, 'animated fadeOutDownBig')});$( document ).ready(function() { $( '.main2' ).addClass( 'bt_visible animated fadeInDownBig'); $( ".main2" ).toggle( "puff" ).delay(3000);});$( document ).ready(function() { $( '.main2' ).addClass( 'bt_visible animated fadeInDownBig'); $( ".main2" ).removeClass( 'bt_visible animated fadeInDownBig').delay(3000); $( '.main2' ).addClass( 'bt_visible animated fadeOutDownBig').delay(3000);});
  2. ....just in case others run into the same problem. Use UI-router(unfortunetaly its not my handywork, but I think I got the picture now)... http://plnkr.co/edit/jnKQOvkE4nJinEQ5zhr6?p=preview
  3. Im trying to create a form, first element should be a <select> tag with a few options and each of them will dynamically bring up a different set of forms depending on what the user chooses. The idea is within the select tag there will be different categories like cars, properties etc.. first user only sees that and when chose, it will bring up a set of input fields that required for that category. Anyone got an idea what would be the best way to do it in angular?
  4. Thank you Foxy, best solution so far. However I still have 2 more major problems. Element and target is in the same wrapper div so when target is resized, it will force the element to a different position which really not looks good and how could I change the delay so the animation looks a bit slower?
  5. I want to create a div and set the opacity to 0 with css(background, color, border) so completely invisible and the whole thing will only work if js enabled. There is another div next to it, and want to use jquery to change the opacity to 1 and change it size. If possible with fadeIN fadeOut. So far i didnt get far, still couldnt even change the opacity, although a researched it. Also I tried mouseenter and mouseover, but no luck yet or to use .hover to create a new div and everyting, but than I need the rest of the page to stay where it is and a new div would change it.. $(document).ready(function(){$("#showCaseWD").hover(function(){$("#wdShow").css({color:rgba(0,0,0,1.0)});});});
  6. Im trying to use jssor slider from github, but when i copy the code it wont work. For some reason the arrows on the left and right side in the main picture dont show up, even tho when you hover over it with your mouse it does work. Also the unselected thumbnail borders are not the right size. Can anyone help me? Also little loading gif wont show up on main big picture just as on thumbnails. I uploaded it to http://sugafreetest.hostoi.com The example what i want to do is http://www.jssor.com/demos/image-gallery.html Thanks
  7. Basically what I am trying to do is, first you enter a number, which will be the number of time the loop should run. When all details entered, it should print out like a payslip for all entries, name, wage, marital status etc..Now the problem is, when I enter example 2 for the loop(numWorkers) at the last round, it will come up with some error in the line of nameWorker[i] = input.next(); Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 20. Also got some problem with the wage obviously im trying to send a double to the wageCalc method, but just cant get it running. Tried plenty of different versions. Anyone could help me on this please? import java.util.Scanner; public class morePay2 { public static double wageCalc(double ratE, double hourS){return (ratE * hourS);} public static void main(String[] args) { Scanner input = new Scanner(System.in); int numWorkers = 0, i = 1; double intWorkedHours = 0, intHourlyRate = 0; System.out.print("Please type in the number of workers: "); numWorkers = input.nextInt();String[] nameWorker = new String[numWorkers];String[] hourlyRate = new String[numWorkers];String[] workedHours = new String[numWorkers];String[] maritalStat = new String[numWorkers];String[] wage = new String[numWorkers]; for (i = 1; i <= numWorkers; i++){System.out.print("Please type in the name: ");nameWorker[i] = input.next();System.out.print("Please type in hourly rate: ");hourlyRate[i] = input.next();System.out.print("Please type in worked hours: ");workedHours[i] = input.next();System.out.print("Please type in marital status(married/single): ");maritalStat[i] = input.next();intHourlyRate = Double.parseDouble(hourlyRate[i]);intWorkedHours = Double.parseDouble(workedHours[i]);wage[i] = wageCalc(intHourlyRate, intWorkedHours);} for (i = 1; i <= numWorkers; i++){System.out.println(nameWorker[i] + " has earned " + wage[i] );} } }
  8. But what is angular JS than? I think it pulls out the actual content, example ad listings is made up of a pic, description and price, all this is stored in an external file if im right. So will prerendering sort out this issue, meaning google searchbots will see the full html with content? Also is there a way to automatically generate a simply html/css version of the website? Eg creating the same website using html and css only and some program-script or anything will pull the data from the angular site to insert it into the html version each time someone posts a new ad
  9. Hi, I hope this subject should be under javascript.. If you design a great website using angularJs, might sound great but what about search engines and visitors without js or whatever other stuff it needs. Could you guys give me some ideas on this subject? Example design a website like gumtree.com, the content is the main thing which is the main thing to be handled by angular, but how you deal with the search engines? Heard about prerender but is google going to look at each possible variation as a new page(which would be good) also if not all your content needs to be dynamic, example you have many static stuff and writings plus products. Is it better to only use angular JS on the product area and keep as much as possible in html? Could I use angular to boost search engine results, like each variation for your product is being seen by google like an new page, more pages = better results.. What if someone does not have JS at all? Is almost anyone have JS installed on the device to have angular be so popular? Also is there a way to use the prerender version of the website for non JS visitors? Like example gumtree. You need to allow the users to post adverts, which has to be stored in a database. Nice and everything, but in this case you can not just write a html version and load that one for each non-JS visitors because that case you would have to modify it each time someone posts a new ad. Is there any automatic way of doing this or any way of having a simple html page automatically created for non js visitors, but having accurate data there! hope you guys can understand what I was on about.
  10. still the same... could you tell me what is (el)? also why do i need (actLinks); at the very end
  11. which supposed to be whichpic right? Now just tried showPic() and showPic(whicpic). No luckyet
  12. Hi, Im trying to run the showPic function without putting any JS into HTML(when i used onclick = showPic() return false, it worked fine). I added prepareGallery function for this reason and I cant get it working. I think I can see it changes the pics but link will be executed also. Anyone got an idea where I made the mistake? <body><h1>Snapshots</h1><ol id="links"><li><a href="benfica.jpg" title="benfica">Benfica</a></li><li><a href="yamaha.jpg" title="yamaha">Yamaha</a></li><li><a href="island.jpg" title="island">Island</a></li><li><a href="opossum.JPG" title="opossum">Opossum</a></li></ol><img id="placeholder" src="1.jpg" alt="my image gallery" /><p id="desc">Choose an image</p></body>function showPic(whichpic) {if (!document.getElementById("placeholder")) return false; var source = whichpic.getAttribute("href");var placeholder = document.getElementById("placeholder");placeholder.setAttribute("src",source);if (!document.getElementsById("desc")) return false;var titletext = whichpic.getAttribute("title");var desc = document.getElementById("desc"); desc.firstChild.nodeValue = titletext;return false;}function prepareGallery(){if (!document.getElementById || !document.getElementsByTagName) return false;var links = document.getElementById("links");var actLinks = links.getElementsByTagName("a");for (var i = 0; i < actLinks.length; i++){actLinks[i].onclick = function(){showPic(this);return false;}}}window.onload = prepareGallery;
  13. is there any other stuff or website where you could recommend free sliders?
  14. second on is Use of getPreventDefault() is deprecated. Use defaultPrevented instead. in jquery-1.10.2.js Ive changed this and the error disappeared but nothing changed. The whole div doesnt show up and some CSS wont work and some other jquery // Events bubbling up the document may have been marked as prevented// by a handler lower down the tree; reflect the correct value.this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
  15. It shows 2 JS errors. first is ReferenceError: TweenMax is not defined // set container 3d propsTweenMax.set(container, {perspective:600})TweenMax.set(carousel, {z:-(radius)})
  16. Anyone got some useful idea how to create a div and give it an X on the top right corner, so if user clicks on it, it will fold away with jquery. Should i just create another div within the main one and position it?? It sound too cheap to me, anyone got a better idea? Thanks
  17. Hi, I am trying to create a decent website. I decided to use some jquery to make it look better, but frankly im struggling with it as im still new to JS and Jquery. I want to add a 3D jquery image slider http://codepen.io/johnblazek/pen/nceyw but as soon as I add it, it messes up my css and nothing is working. In the header is used <link href="css/ui-lightness/jquery-ui-1.10.4.min.css" rel="stylesheet"><script src="js/jquery-1.10.2.js"></script><script src="js/jquery-ui-1.10.4.js"></script> index.html style.css
  18. Thank you Davej, would you sell any of your knowledge?? If braincells can be transferred, I would be happy to buy just a small piece of it, that would be more than enough for me..
  19. In my sample, each branch has 2 medicines, each medicine will have a stocklist with the PK stocklist_id. Should I add each stocklist_id separately? Also do i need to repeat the insert into statement for each line or can i just do it for each table like insert into branches (...) values values values? I uploaded the ddl in a txt. Could you give me any comment on that? Also it should not be enhanced as this is quite close to what I have to cover and that is all i have got to do, just need to make it work. I have to populate the tables and have a few sql commands to retrieve different data. Job role will be deleted, instead i will create sub-types of employees such as managers, cleaners etc.. Im working on that now sql.txt
  20. Hi, I have created a database but when I try to insert data in oracle, I get an error ORA-02291: integrity constraint (T.BRANCHES_MEDICINE_STOCK_FK) violated - parent key not found. This branches medicine stock fk is above the relation between branches and medicine table. I used INSERT INTO Branches (branch_id, branch_name, stocklist_id, contact_id) VALUES ('b01','London Road','mst01,mst02','cd01');INSERT INTO Branches (branch_id, branch_name, stocklist_id, contact_id) VALUES ('b02','Loughborough Road','mst03,mst04','cd02');INSERT INTO Branches (branch_id, branch_name, stocklist_id, contact_id) VALUES ('b03','Newark Street','mst05,mst06','cd03');INSERT INTO Branches (branch_id, branch_name, stocklist_id, contact_id) VALUES ('b04','Marsden Lane','mst07,mst08','cd04');INSERT INTO Medicine_Stock (stocklist_id, medicine_name, amount_in_stock) VALUES ('mst01','Nurofen',1566);INSERT INTO Medicine_Stock (stocklist_id, medicine_name, amount_in_stock) VALUES ('mst02','4Head',933);INSERT INTO Medicine_Stock (stocklist_id, medicine_name, amount_in_stock) VALUES ('mst03','Nurofen',455);INSERT INTO Medicine_Stock (stocklist_id, medicine_name, amount_in_stock) VALUES ('mst04','4Head',152);INSERT INTO Medicine_Stock (stocklist_id, medicine_name, amount_in_stock) VALUES ('mst05','Nurofen',1012);INSERT INTO Medicine_Stock (stocklist_id, medicine_name, amount_in_stock) VALUES ('mst06','4Head',752);INSERT INTO Medicine_Stock (stocklist_id, medicine_name, amount_in_stock) VALUES ('mst07','Nurofen',8);INSERT INTO Medicine_Stock (stocklist_id, medicine_name, amount_in_stock) VALUES ('mst08','4Head',350); As I used an sql script, the order shouldnt matter if im right, I declared all primary keys in both tables, branches and medicine stock, what else do i need to do?
  21. and for function deleteComment I think there should be and else thingy as well, but what should I write there if I dont want it to do anything because if top box not checked I get an error msg or some sort of loop should be there?
  22. this was the closest I got I think. Could anyone help me correct it pls? Thank you function deleteComment(){var x = document.getElementById("checkbox")[0][i++];for(var i=0; i<check.length; i++); if (x.checked == true)var parent=document.getElementById("div1"); var child=document.getElementById("p"); parent.removeChild(child);}
  23. Hi, I am still working on this. I got this far, but when I want to delete a new node, I have to thick it and it can only be the top one and only 1 at the time. Could someone help me how to force it to delete all checked nodes at the same time? Some loop would do it? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>HTML</title><script> function addNew(){ var inputText=form.inputText.value; var para=document.createElement("p"); para.setAttribute("id", "p"); var check=document.createElement("INPUT"); check.setAttribute("type", "checkbox"); check.setAttribute("id", "checkbox"); para.appendChild(check); var node=document.createTextNode(inputText); para.appendChild(node); var element=document.getElementById("div1"); element.appendChild(para); } function deleteComment(){var x = document.getElementById("checkbox"); if (x.checked == true)var parent=document.getElementById("div1"); var child=document.getElementById("p"); parent.removeChild(child);} </script></head> <body><form id="form"> <input type="text" value="inputText" id="inputText" /> <input type="button" value="Add New Comment" onclick="addNew()" /> <input type="button" value="Delete A Comment" onclick="deleteComment()" /></form> <div id="div1"> </div> </body></html>
  24. I sorted out the confirmation box..proud of myself:)
×
×
  • Create New...