Results 1 to 23 of 23

Thread: CSS ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Apr:2007
    Location: Sofia
    Posts: 7

    CSS ?

    !

    :

    http://zapadni-ezici.info/index.php

    index.php $_GET .
    $_GET["s"] (s section) .

    :

    Code:
    <?php
    function ChangeStyle() {
    
    switch ($_GET["s"]) {
    
    case "main" :
    echo ".main {
    	background-position: 0px -84px;}";
    break;
    
    case "courses" :
    echo ".courses {
    	background-position: -142px -84px;}";
    break;
    
    case "teachers" :
    echo ".teachers {
    	background-position: -231px -84px;}";
    break;
    
    case "sertificates" :
    echo ".sertificates {
    	background-position: -375px -84px;}";
    break;
    
    case "translations" :
    echo ".translations {
    	background-position: -515px -84px;}";
    break;
    
    case "links" :
    echo ".links {
    	background-position: -605px -84px;}";
    break;
    
    default:
    echo ".main {
    	background-position: 0px -84px;}";
    break;
    }
    }
    
    ?>
    :

    Code:
    <?php
    echo '<style> ';
    echo ChangeStyle();
    echo ' </style>';
    
    ?>

    <head></head>

    1. - ?

    ----------------------------------------------------------------------------------------------

    2. $_GET["p"] (p = page)
    .

    .

    case , .

    ID- ?

    ?

    !!!

  2. #2
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    CSS, . CSS ( - ).
    , - - . - - . '' . , , ().
    . (s p), - p , , ( ). - css , - , , :
    <td class="button<?php if ($_GET['p']=='certificates' echo '_selected';?>">
    - , , _selected, koeto .
    .

  3. #3
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    . -> <a href="index.php" title="Home" class="<?=$home_cur?>">Site</a> $home_cur = "current"; - ( - Survive, ).

    : . .
    Last edited by z0ne; 31st May 2007 at 01:43.

  4. #4
    Registered User
    Join Date: Apr:2007
    Location: Sofia
    Posts: 7
    Quote Originally Posted by z0ne View Post
    . -> <a href="index.php" title="Home" class="<?=$home_cur?>">Site</a> $home_cur = "current"; - ( - Survive, ).

    : . .
    $home_cur?

    ?

  5. #5
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    Quote Originally Posted by z0ne View Post
    . -> <a href="index.php" title="Home" class="<?=$home_cur?>">Site</a> $home_cur = "current"; -
    , , . HMTL . . , ... embedded php e ...

  6. #6
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    1000 <title></title>,<html></html>,<head></head> ..

    ? (include) home.php menu.php => home.php $home_cur "selected" . tedych.

  7. #7
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    . , - . * PHP - ~ 1MB*

  8. #8
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    Quote Originally Posted by z0ne View Post
    . , - . * PHP - ~ 1MB*
    . embedded php . - , ... . . , , - , div. , - . - , -.
    , 60-70 ... , ... .
    embedded php - ...,

  9. #9
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Quote Originally Posted by genn View Post
    . embedded php . - , ... . . , , - , div. , - . - , -.
    , 60-70 ... , ... .
    embedded php - ...,
    . :

    - ,,, ..
    - header,footer, ..
    -
    - php

    - <> . .

    .. <table>, CSS id-. - .

  10. #10
    Registered User
    Join Date: Apr:2007
    Location: Sofia
    Posts: 7
    , :

    Javascript :

    Code:
    function getParameter(name) {
       var url = window.location.href;
       var paramsStart = url.indexOf("?");
    
       if(paramsStart != -1){
    
          var paramString = url.substr(paramsStart + 1);
          var tokenStart = paramString.indexOf(name);
    
          if(tokenStart != -1){
    
             paramToEnd = paramString.substr(tokenStart + name.length + 1);
             var delimiterPos = paramToEnd.indexOf("&");
    
             if(delimiterPos == -1){
                return paramToEnd;
             }
             else {
                return paramToEnd.substr(0, delimiterPos);
             }
          }
       }
    }
    "p" URL-.

    :

    Code:
    function changeStyle() {
    	
    		if (getParameter('p')) {
    			var tag = getParameter('p');
    			var tagClass = document.getElementById(tag);
    			tagClass.className = "selected";
    		}
    }
    selected

    "p" ID- .

  11. #11
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , Krisko PHP, ..
    , - .
    <div ? . <div> - , <table>.
    .. , - - . , .

  12. #12
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    , . AJAX JavaScript.

  13. #13
    Registered User Annihilator's Avatar
    Join Date: Jun:2004
    Location: Sofia
    Posts: 1,316
    Quote Originally Posted by z0ne View Post
    , . AJAX JavaScript.
    - request , . development environment , production - . , client-side. , ajax , client-side, -.
    .

    genn -. MVC , .

  14. #14
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    , , "".

  15. #15
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    Quote Originally Posted by z0ne View Post
    , , "".
    , ?
    ... .
    , ... .
    , , , . . , -> - .

  16. #16
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331

    Smile

    , . , host.bg - !, : SELECT * FROM... 1 , ., , . , Server Side -!

    .

  17. #17
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by z0ne View Post
    , Server Side -!

    ? . Server side , client side JavaScript . AJAX call JavaScript ( -- JavaScript). .

  18. #18
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    Quote Originally Posted by Pesho View Post
    ? . Server side , client side JavaScript . AJAX call JavaScript ( -- JavaScript). .
    . ajax- .
    '', , , client-side - , , . , .
    .
    , , , , () - 300 . 500 , . , .
    , , , . , . ajax ( GMail), , .

  19. #19
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    . , AJAX . + , - .

  20. #20
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by z0ne View Post
    . , AJAX . + , - .

    . AJAX . ( AJAX vs. JavaScript)?

  21. #21
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    , - . abv.bg . ( ) JS.

    .. , "" , AJAX.

  22. #22
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by z0ne View Post
    .. , "" , AJAX.

    . AJAX - . -AJAX JavaScript .

  23. #23
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , zOne , , AJAX- ( ), , , .
    , '' AJAX.
    , JS , , , AJAX- . .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |