Jump to content

Matej

Members
  • Content Count

    185
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Matej

  • Rank
    Member
  1. as i mentioned, i tried to add width to .info and it still behaves the same
  2. The parent container of .info ineed has explicit ( 100% width ) , i set the width of .info to certain value also but the behavior is the same
  3. Using this when i have a multiple elements in centered DIV and i set positive value to a margin on any of them results in others elements recieve the same margin but negative. e.g <div class="info"> <h1>TeXT GoeSt here</h1> <p>bla bla bla bla bla bla</p> <button class="myButton">Leave a Button</button> </div> .info{ position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); } .info h1{ position: relative; font-family: Roboto Bold; font-size: 90px; margin-top: -130px; } this is fine cuz there is a negative value but .info .myButton{ position: relative; border: none; color: white; text-decoration: none; width: 200px; height: 50px; background: #FF0505; outline: none; cursor: pointer; margin-top: 200px; } does not just move the element. it moves all others elements the oposite way...
  4. What is the trick to center div horizontally and vertically at the same time? I have this demo and need to center the div with the text in the middle of its parent div. How can i do such a thing?
  5. I have updated css file for media queries , but there is a problem , it wont show its effect on site , i have made test with background color , @media screen and (max-width: 1200px) { body{background-color:blue;} } When i resize the browser , it actually shows media queries there but does not show result , how can i fixt it?
  6. thats it , its aint displaying in right order or somehing , the ordering script works i tested it , but somehow its broken or something , as i said i solved this exercisee first time with diferent script which aint working aymore , so ii dont know mistake is on my side or on their. Thats why i posted it . to find out if I did mistake.
  7. indeed , as i said i said i thought its printing just wrong order ,that why i sorted it based on urls array that mean result from url 0 is on 0 position but it still says i failed
  8. hi , im trying to solve said exercise in nodeschool LEARN YOU THE NODE.JS FOR MUCH WIN! ───────────────────────────────────── JUGGLING ASYNC Exercise 9 of 13This problem is the same as the previous problem (HTTP COLLECT) in that you need to use http.get(). However, this time you will be provided with three URLs as the first three command-line arguments.You must collect the complete content provided to you by each of the URLs and print it to the console (stdout). You don't need to print out the length, just the data as a String; one line per URL. The catch is that you must print them out in the same order as the URLs are provided to you as command-line arguments.-------------------------------------------------------------------------------## HINTSDon't expect these three servers to play nicely! They are not going to give youcomplete responses in the order you hope, so you can't naively just print the output as you get it because they will be out of order.You will need to queue the results and keep track of how many of the URLs have returned their entire contents. Only once you have them all, you can print the data to the console.Counting callbacks is one of the fundamental ways of managing async in Node. Rather than doing it yourself, you may find it more convenient to rely on a third-party library such as [async](http://npm.im/async) or [after](http://npm.im/after). But for this exercise, try and do it without any external helper library.------------------------------------------------------------------------------- first i solved it like this (first time it worked) var http=require("http");var urls=process.argv.slice(2,process.argv.length);var count=0;var junge=[];urls.map(function(url,index){http.get(url,function(response){var str="";response.setEncoding("utf-8");response.on("data",function(data){str=str+data})response.on("end",function(){junge.push(str);count++;if(index==urls.length-1) junge.map(function(v){console.log(v)})});});}) but second and so on time it threw that i failed , so i thought maybe its printing in the wrong order? So before i prined it i sorted it. and final code looks like this var http=require("http");var urls=process.argv.slice(2,process.argv.length);var junge=[];var finaly=[];urls.map(function(url,index){http.get(url,function(response){var str="";response.setEncoding("utf-8");response.on("data",function(data){str=str+data})response.on("end",function(){junge.push({text:str,url:url});if(index==urls.length-1) {urls.forEach(function(m){var is=false;junge=junge.filter(function(x){if(!is && x.url==m){finaly.push(x);is=true;return false;}elsereturn true;})})finaly.forEach(function(y){console.log(y.text)})}});});}) the error just says i failed , but the result looks differently every time , here is the recent one 1. ACTUAL: "Grab us a fly wire no worries she'll be right rego. Trent from punchy trackies with flat out like a parma. As stands out like two pot screamer and you little ripper waratah. "1. EXPECTED: "Flat out like a two pot screamer with he hasn't got a ya. You little ripper flanno piece of piss built like a trackie dacks. He's got a massivehottie with get a dog up ya cranky. Built like a franger mate lets throw a gonewalkabout. "2. ACTUAL: ""2. EXPECTED: "Get a dog up ya rapt my as stands out like ute. Stands out likea chuck a sickie and get a dog up ya cactus mate. Stands out like a bitzer heaps she'll be right cubby house. Watch out for the bushranger no worries as cunning as a bitzer. As stands out like bushranger also gutful of smoko. "3. ACTUAL:3. EXPECTED: ""────────────────────────────────────────────────────────────────────────────────? Submission results did not match expected!# FAILYour solution to JUGGLING ASYNC didn't pass. Try again! any help?
  9. Hola, have you taken a look at it yet? Ihave ordered that book for promises , but does it include fetch api which is based on promises?
  10. Matej

    facebook like

    Hi , im trying to impelement fb likes on site code <script> window.fbAsyncInit = function() { FB.init({ appId : 'id i recieved', xfbml : true, version : 'v2.3' }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div> but as i do what i do , the button just wont show up , it does not even throw any error. Does anyone have experience with stufflike this?
  11. Matej

    ajax and images

    So thats the way images are stored? Just store path in xml/json and getbthat path using ajax? Well makes sense ... This way i can dynamicli add pictures... Thanks
  12. Matej

    ajax and images

    How are images loaded from server if not via Ajax? im working on my site where i want to retrieve images from server + im planning to add more and more images to the server so i supposed it would be best with ajax which would result in automaticly updait content on website.
  13. Matej

    ajax and images

    Hi. Im trying to learn AJAX. In my WAMPSERVER www.directory i have a file called IMAGES. inside that file there is an image called logo.png. Im trying to retrieve this image from server using this code function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function(){if (xmlhttp.readyState==4 && xmlhttp.status==200){var response = xmlhttp.responseText;var img=document.createElement("img");img.src=response;var myDiv=document.getElementById("one");myDiv.appendChild(img);}}xmlhttp.open("get","images/logo.png",true);xmlhttp.send();}window.onclick=loadXMLDoc In chrome it throws error about cross origin or something (restriction). But in firefox it does append image but without src and it throws error "not well formed". If i change code a bit to only innerHTMl to said div and using xmlhttp.open("get","images/change.txt",true); it works. So, what is the right way to retrieve image from server? Also , lets say i have more images in "images" folder , how could i retrieve them all? also when i change it to xmlhttp.open("get","images/brm.jpg",true); which is another image in the folder it throws error NS_ERROR_DOM_BAD_­URI: Access to restricted URI denied
  14. Matej

    position fixed trick

    Using position fixed , the element would be in the same position after scroll and so on. Im talking about achieving similar effect like .menu { background:url("") no-repeat fixed center } but with elements also and not just background.
  15. Matej

    position fixed trick

    Hello , how is possible to make similar trick as with background:url("")no-repeat fixed center? What i am trying to do is to let "text" do the same effect as with this background here is a demo. http://jsfiddle.net/Trolstover/2kvhgga0/ as you can see here , the images arent "Scrolling up" thanks to background fixed position but i want to achieve that the text will be the same. Nice example is on this site i've found http://www.loono.cz/ first image with button. Thanks for answers
×
×
  • Create New...